thang an bi ngu

This commit is contained in:
2024-10-06 20:42:02 +07:00
parent 7b678a7ef2
commit 83b453c3b8
9 changed files with 202 additions and 23 deletions

View File

@@ -1,10 +1,36 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { cors } from './common/utils/cors.utils';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
// Import DateTime scalar if necessary
require('./common/utils/datetime.utils');
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors(cors);
await app.listen(3069);
const config = new DocumentBuilder()
.setTitle('EPESS API')
.setDescription('API documentation for EPESS application')
.setVersion('1.0')
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document);
document.paths['/graphql'] = {
get: {
summary: 'GraphQL Playground',
description: 'Access the GraphQL Playground to interact with the GraphQL API.',
responses: {
'200': {
description: 'GraphQL Playground',
},
},
},
};
await app.listen(3000);
}
bootstrap();