| Current Path : /proc/thread-self/root/proc/thread-self/root/home/deltalab/PMS/logistic-backend/src/ |
| Current File : //proc/thread-self/root/proc/thread-self/root/home/deltalab/PMS/logistic-backend/src/main.ts |
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import helmet from 'helmet';
import { AppConfigService } from './config/app/config.service';
import * as compression from 'compression';
import { VersioningType } from '@nestjs/common';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const appConfig: AppConfigService = app.get(AppConfigService);
app.use(helmet());
app.enableCors();
app.use(compression());
app.setGlobalPrefix('logistic-backend');
app.enableVersioning({
type: VersioningType.URI,
});
const swaggerConfig = new DocumentBuilder()
.setTitle('Logistic service')
.setDescription('REST API for the logistic service app')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, swaggerConfig);
SwaggerModule.setup('docs', app, document);
await app.listen(appConfig.port);
}
bootstrap();