Skip to content

Commit

Permalink
chore: remove chalk blue text
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Aug 6, 2024
1 parent a07a5af commit 6ff748b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cortex-js/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getApp = async (host?: string, port?: number) => {
enableDebugMessages: true,
}),
);

cleanLogs();
const config = new DocumentBuilder()
.setTitle('Cortex API')
Expand Down
7 changes: 2 additions & 5 deletions cortex-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -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?`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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);
}
Expand Down
11 changes: 4 additions & 7 deletions cortex-js/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
defaultCortexJsPort,
} from '@/infrastructure/constants/cortex';
import { getApp } from './app';
import chalk from 'chalk';

process.title = 'Cortex API Server';

Expand All @@ -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}`);
}
}

Expand Down

0 comments on commit 6ff748b

Please sign in to comment.