diff --git a/cortex-js/src/app.ts b/cortex-js/src/app.ts index c02edd428..53104b886 100644 --- a/cortex-js/src/app.ts +++ b/cortex-js/src/app.ts @@ -26,7 +26,7 @@ export const getApp = async (host?: string, port?: number) => { enableDebugMessages: true, }), ); - + cleanLogs(); const config = new DocumentBuilder() .setTitle('Cortex API') diff --git a/cortex-js/src/index.ts b/cortex-js/src/index.ts index 601955bf4..4d31b2eeb 100644 --- a/cortex-js/src/index.ts +++ b/cortex-js/src/index.ts @@ -12,11 +12,10 @@ import { CortexUsecases } from './usecases/cortex/cortex.usecases'; * Start the API server */ export async function start(host?: string, port?: number) { - const app = await getApp(host, port); // getting port from env const sHost = host || process.env.CORTEX_JS_HOST || defaultCortexJsHost; const sPort = port || process.env.CORTEX_JS_PORT || defaultCortexJsPort; - + const app = await getApp(sHost, Number(sPort)); try { await app.listen(sPort, sHost); const cortexUsecases = await app.resolve(CortexUsecases); diff --git a/cortex-js/src/main.ts b/cortex-js/src/main.ts index 1a43ca318..988e55426 100644 --- a/cortex-js/src/main.ts +++ b/cortex-js/src/main.ts @@ -6,11 +6,10 @@ import { getApp } from './app'; import chalk from 'chalk'; async function bootstrap() { - const app = await getApp(); // getting port from env const host = process.env.CORTEX_JS_HOST || defaultCortexJsHost; const port = process.env.CORTEX_JS_PORT || defaultCortexJsPort; - + const app = await getApp(host, Number(port)); try { await app.listen(port, host); console.log(chalk.blue(`Started server at http://${host}:${port}`));