Files
gongxue-base/apps/server/src/main.ts

19 lines
490 B
TypeScript

import { NestFactory } from '@nestjs/core';
import helmet from 'helmet';
import compression from 'compression';
import { AppModule } from './app.module';
import { runMigrationsOnStartup } from './migration-runner';
async function bootstrap() {
await runMigrationsOnStartup();
const app = await NestFactory.create(AppModule);
app.setGlobalPrefix('api');
app.enableCors();
app.use(helmet());
app.use(compression());
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();