-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.ts
28 lines (24 loc) · 881 Bytes
/
App.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { NestFactory } from '@nestjs/core';
import { Logger } from "@nestjs/common";
import 'reflect-metadata'
import { ApplicationModule } from './app.module';
import config from './src/config/config'
const PORT = config.serverPort
const prefix = '/api'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
async function bootstrap() {
const app = await NestFactory.create(ApplicationModule);
app.enableCors()
app.setGlobalPrefix(prefix)
const options = new DocumentBuilder()
.setTitle('Nest starter endpoints')
.setDescription('Available interactions with the backend services')
.setBasePath(prefix)
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup(`${prefix}/swagger`, app, document);
Logger.log('App started on port ' + PORT)
await app.listen(PORT);
}
bootstrap()