xiaoju-survey/server/src/main.ts

29 lines
772 B
TypeScript
Raw Normal View History

2024-01-30 14:19:45 +00:00
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
2024-03-28 13:37:59 +00:00
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
2024-01-30 14:19:45 +00:00
async function bootstrap() {
const PORT = process.env.PORT || 3000;
2024-01-30 14:19:45 +00:00
const app = await NestFactory.create(AppModule);
2024-03-28 13:37:59 +00:00
const config = new DocumentBuilder()
.setTitle('XIAOJU SURVEY')
.setDescription('')
.setVersion('1.0')
.addTag('auth')
.addTag('survey')
.addTag('surveyResponse')
.addTag('messagePushingTasks')
.addTag('ui')
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('swagger', app, document);
await app.listen(PORT);
console.log(`server is running at: http://127.0.0.1:${PORT}`);
2024-01-30 14:19:45 +00:00
}
2024-01-30 14:19:45 +00:00
bootstrap();