multica/src/console/main.ts
Naiyuan Qing 30a1fd02b8 feat(console): enable CORS for cross-origin web app requests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:40:38 +08:00

21 lines
601 B
TypeScript

import "reflect-metadata";
import { NestFactory } from "@nestjs/core";
import { Logger } from "nestjs-pino";
import { AppModule } from "./app.module.js";
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule, { bufferLogs: true });
app.enableCors();
app.useLogger(app.get(Logger));
const port = process.env["PORT"] ?? 4000;
await app.listen(port);
const logger = app.get(Logger);
logger.log(`Console is running on http://localhost:${port}`);
}
bootstrap().catch((err) => {
console.error("Failed to start console:", err);
process.exit(1);
});