import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { ConfigService } from '@nestjs/config'; import * as cookieParser from 'cookie-parser'; async function bootstrap() { const app = await NestFactory.create(AppModule); const configService = app.get(ConfigService); app.use(cookieParser()); const prefix = configService.get('GLOBAL_PREFIX'); app.setGlobalPrefix(prefix); const port = configService.get('PORT'); await app.listen(port); } bootstrap();