Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 1 addition & 2 deletions cortex-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions cortex-js/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`));
Expand Down