seedling/source/rest/src/main.ts

29 lines
599 B
TypeScript
Raw Normal View History

// @ts-nocheck
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// swagger
SwaggerModule.setup(
'api',
app,
SwaggerModule.createDocument(
app,
new DocumentBuilder()
.setTitle('$(AppName) API')
.setDescription('The $(AppName) API description.')
.setVersion('0.1.0')
.addServer('/api/v1')
.build(),
),
);
app.setGlobalPrefix('/api/v1');
await app.listen(8080);
}
bootstrap();