diff --git a/src/api/api.ts b/src/api/api.ts index 7b80ece..0aede4b 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { ApiConfig } from './api.types'; -export class Api { +export class Api { protected app: WebFramework; constructor(protected config: ApiConfig) {} diff --git a/src/api/start-api.ts b/src/api/start-api.ts index cbea433..3b7bd99 100644 --- a/src/api/start-api.ts +++ b/src/api/start-api.ts @@ -2,11 +2,11 @@ import 'reflect-metadata'; import { Route } from '@alien-worlds/api-core'; import { Api } from './api'; -import { ApiConfig } from './api.types'; - -export const startApi = async (config: ApiConfig, routes: Route[] = []) => { - const api = new Api(config); +export const startApi = async ( + api: Api, + routes: Route[] = [] +) => { routes.forEach(route => { Route.mount(api, route); });