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/command.ts b/cortex-js/src/command.ts index b8921ba70..37aa2a77a 100644 --- a/cortex-js/src/command.ts +++ b/cortex-js/src/command.ts @@ -13,7 +13,7 @@ dependenciesSpinner.succeed( ); process.removeAllListeners('warning'); -process.title = 'Cortex Command Executor'; +process.title = 'Cortex CLI Command Process'; async function bootstrap() { let telemetryUseCase: TelemetryUsecases | null = null; diff --git a/cortex-js/src/index.ts b/cortex-js/src/index.ts index 601955bf4..239834913 100644 --- a/cortex-js/src/index.ts +++ b/cortex-js/src/index.ts @@ -5,7 +5,6 @@ import { defaultCortexJsPort, } from '@/infrastructure/constants/cortex'; import { getApp } from './app'; -import chalk from 'chalk'; import { CortexUsecases } from './usecases/cortex/cortex.usecases'; /** @@ -21,10 +20,8 @@ export async function start(host?: string, port?: number) { await app.listen(sPort, sHost); const cortexUsecases = await app.resolve(CortexUsecases); await cortexUsecases.startCortex(); - console.log(chalk.blue(`Started server at http://${sHost}:${sPort}`)); - console.log( - chalk.blue(`API Playground available at http://${sHost}:${sPort}/api`), - ); + console.log(`Started server at http://${sHost}:${sPort}`); + console.log(`API Playground available at http://${sHost}:${sPort}/api`); } catch { console.error(`Failed to start server. Is port ${port} in use?`); } diff --git a/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts b/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts index ddc24d2d2..98746894c 100644 --- a/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts +++ b/cortex-js/src/infrastructure/commanders/cortex-command.commander.ts @@ -91,7 +91,7 @@ export class CortexCommand extends CommandRunner { this.host = options?.address || configApiServerHost || defaultCortexJsHost; this.port = options?.port || configApiServerPort || defaultCortexJsPort; - if(this.host === 'localhost') { + if (this.host === 'localhost') { this.host = '127.0.0.1'; } this.enginePort = @@ -122,9 +122,7 @@ export class CortexCommand extends CommandRunner { const isServerOnline = await this.cortexUseCases.isAPIServerOnline(); if (isServerOnline) { console.log( - chalk.blue( - `Server is already running at http://${this.configHost}:${this.configPort}. Please use 'cortex stop' to stop the server.`, - ), + `Server is already running at http://${this.configHost}:${this.configPort}. Please use 'cortex stop' to stop the server.`, ); process.exit(0); } diff --git a/cortex-js/src/main.ts b/cortex-js/src/main.ts index 89382ecb2..a2076f158 100644 --- a/cortex-js/src/main.ts +++ b/cortex-js/src/main.ts @@ -3,7 +3,6 @@ import { defaultCortexJsPort, } from '@/infrastructure/constants/cortex'; import { getApp } from './app'; -import chalk from 'chalk'; process.title = 'Cortex API Server'; @@ -15,12 +14,10 @@ async function bootstrap() { try { await app.listen(port, host); - console.log(chalk.blue(`Started server at http://${host}:${port}`)); - console.log( - chalk.blue(`API Playground available at http://${host}:${port}/api`), - ); - } catch { - console.error(`Failed to start server. Is port ${port} in use?`); + console.log(`Started server at http://${host}:${port}`); + console.log(`API Playground available at http://${host}:${port}/api`); + } catch (error) { + console.error(`Failed to start server. Is port ${port} in use? ${error}`); } } diff --git a/cortex-js/src/utils/cortex-cpp.ts b/cortex-js/src/utils/cortex-cpp.ts index 79f1aa70c..efa28adbd 100644 --- a/cortex-js/src/utils/cortex-cpp.ts +++ b/cortex-js/src/utils/cortex-cpp.ts @@ -1,6 +1,6 @@ import * as cortexCPP from 'cortex-cpp'; -process.title = 'Cortex Engine Server'; +process.title = 'Cortex Engine Process (cortex.cpp)'; const port = process.env.CORTEX_CPP_PORT ? parseInt(process.env.CORTEX_CPP_PORT) : 3929;