You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
665 B
TypeScript

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as config1 from 'config';
import { Logger } from '@nestjs/common';
import { urlencoded, json } from 'express';
async function bootstrap() {
const serverConfig = config1.get('server');
const logger = new Logger('bootstrap');
const app = await NestFactory.create(AppModule);
const port = serverConfig.port;
app.setGlobalPrefix('api/v1');
app.enableCors();
app.use(json({ limit: '50mb' }));
app.use(urlencoded({ extended: true, limit: '50mb' }));
await app.listen(port);
logger.log(`Application listing on port ${port}`) // for logging
}
bootstrap()