mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 18:08:16 +00:00
23 lines
726 B
TypeScript
23 lines
726 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
import { ConfigService } from '@nestjs/config';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
const config = app.get(ConfigService);
|
|
|
|
const corsOrigins = config.get<string[]>('corsOrigins') || ['http://localhost:5173'];
|
|
|
|
app.enableCors({
|
|
origin: corsOrigins,
|
|
credentials: true,
|
|
methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
|
|
allowedHeaders: ['Content-Type', 'Accept', 'Authorization'],
|
|
});
|
|
|
|
const port = config.get('port');
|
|
await app.listen(port);
|
|
console.log(`Helix Engage Server running on port ${port}`);
|
|
}
|
|
bootstrap();
|