diff --git a/src/api/start-api.ts b/src/api/start-api.ts index a4fe4c9..f0ce1c1 100644 --- a/src/api/start-api.ts +++ b/src/api/start-api.ts @@ -11,14 +11,13 @@ export const startApi = async (dependencies: ApiDependencies, ...args: string[]) const vars = new ConfigVars(); const options = apiCommand.parse(args).opts(); const config = buildApiConfig(vars, databaseConfigBuilder, options); - const routes = routesProvider(ioc); await setupIoc(config, ioc); api.setup(config); - routes.forEach(route => { - Route.mount(api, route); + routesProvider(ioc).forEach(route => { + Route.mount(api.framework, route); }); return api.start();