23 lines
690 B
TypeScript
23 lines
690 B
TypeScript
import 'reflect-metadata';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
|
import { AppModule } from './app.module';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
app.setGlobalPrefix('api');
|
|
|
|
const swaggerConfig = new DocumentBuilder()
|
|
.setTitle('CMPP Platform API')
|
|
.setDescription('First-version CMPP SMS platform API')
|
|
.setVersion('0.1.0')
|
|
.build();
|
|
const document = SwaggerModule.createDocument(app, swaggerConfig);
|
|
SwaggerModule.setup('api/docs', app, document);
|
|
|
|
const port = Number(process.env.API_PORT ?? 3000);
|
|
await app.listen(port);
|
|
}
|
|
|
|
void bootstrap();
|