MCPcopy Create free account
hub / github.com/axe-api/axe-api / bindDependencies

Method bindDependencies

packages/axe-api/src/Server.ts:56–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

startMethod · 0.95

Calls 3

singletonMethod · 0.80
debugMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected