File: //var/www/ai-notam/src/main.ts
import {NestFactory} from '@nestjs/core';
import {ConfigService} from '@nestjs/config';
import {AppModule} from './modules/app.module';
import {EnvModel} from './common/models/config/env.model';
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule, {
bufferLogs: true,
});
const config = app.get<ConfigService>(ConfigService<EnvModel>);
if (config.get('CORS_ENABLED')) {
app.enableCors();
}
await app.listen(config.get('PORT'));
}
void bootstrap();