traintrape-moi/server/src/main.ts

20 lines
670 B
TypeScript
Raw Normal View History

2024-12-07 09:24:41 +00:00
import { NestFactory } from '@nestjs/core'
import { AppModule } from './app.module'
2024-12-07 09:32:44 +00:00
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
2024-12-07 11:20:57 +00:00
import { ValidationPipe } from '@nestjs/common'
2024-12-01 11:30:56 +00:00
async function bootstrap() {
2024-12-07 09:24:41 +00:00
const app = await NestFactory.create(AppModule)
2024-12-07 11:20:57 +00:00
app.useGlobalPipes(new ValidationPipe())
2024-12-07 09:32:44 +00:00
const config = new DocumentBuilder()
.setTitle('Traintrape-moi')
.setDescription('API permettant de stocker les données de Traintrape-moi')
.setVersion('1.0')
.build()
const document = SwaggerModule.createDocument(app, config)
SwaggerModule.setup('', app, document);
2024-12-07 09:24:41 +00:00
await app.listen(process.env.PORT ?? 3000)
2024-12-01 11:30:56 +00:00
}
2024-12-07 09:24:41 +00:00
bootstrap()