()
| 54 | } |
| 55 | |
| 56 | private async bindDependencies() { |
| 57 | const api = APIService.getInstance(); |
| 58 | IoCService.singleton("SchemaInspector", () => schemaInspector); |
| 59 | IoCService.singleton("App", () => new App()); |
| 60 | IoCService.singleton("Database", async () => { |
| 61 | const database = knex(api.config.database); |
| 62 | const { client } = api.config.database; |
| 63 | const { database: db, filename } = api.config.database.connection as any; |
| 64 | LogService.debug( |
| 65 | `Created a knex connection instance: [${client}:${db || filename}]`, |
| 66 | ); |
| 67 | attachPaginate(); |
| 68 | LogService.debug("Added pagination support to the knex"); |
| 69 | return database; |
| 70 | }); |
| 71 | IoCService.singleton("Redis", () => { |
| 72 | return new RedisAdaptor(api.config.redis, ""); |
| 73 | }); |
| 74 | IoCService.singleton("Elastic", () => { |
| 75 | return new ElasticService(api.config.search, api.config.elasticSearch); |
| 76 | }); |
| 77 | } |
| 78 | |
| 79 | private async analyzeVersions() { |
| 80 | const api = APIService.getInstance(); |
no test coverage detected