monorepo-microservice-rbac/apps/services/aorta/gateway/src/main.ts
2023-08-27 14:37:59 +08:00

16 lines
504 B
TypeScript

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();