From 14a5b86f22474f4c8ab358412c57b538edc6ff29 Mon Sep 17 00:00:00 2001 From: rkamysz Date: Tue, 25 Jul 2023 11:46:16 +0200 Subject: [PATCH] update api --- src/api/api.dependencies.ts | 4 +--- src/api/start-api.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/api/api.dependencies.ts b/src/api/api.dependencies.ts index 6f7ce27..478c97d 100644 --- a/src/api/api.dependencies.ts +++ b/src/api/api.dependencies.ts @@ -1,7 +1,6 @@ import { Result } from '@alien-worlds/api-core'; import { DatabaseConfigBuilder, Dependencies } from '../common'; import { Api } from './api'; -import { ApiConfig } from './api.types'; /** * An abstract class representing a Api dependencies. @@ -9,8 +8,7 @@ import { ApiConfig } from './api.types'; */ export abstract class ApiDependencies extends Dependencies { public api: Api; - public databaseConfigBuilder: DatabaseConfigBuilder; - public abstract initialize(config: ApiConfig): Promise; + public abstract initialize(): Promise; } diff --git a/src/api/start-api.ts b/src/api/start-api.ts index 8de318d..5465dd1 100644 --- a/src/api/start-api.ts +++ b/src/api/start-api.ts @@ -11,10 +11,10 @@ export const startApi = async ( routes: Route[] = [], ...args: string[] ) => { - const { api } = dependencies; + const { api, databaseConfigBuilder } = dependencies; const vars = new ConfigVars(); const options = apiCommand.parse(args).opts(); - const config = buildApiConfig(vars, dependencies.databaseConfigBuilder, options); + const config = buildApiConfig(vars, databaseConfigBuilder, options); api.setup(config);