29 lines
858 B
TypeScript
29 lines
858 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
app.setGlobalPrefix('api/v1');
|
|
|
|
|
|
//swagger configuration
|
|
|
|
const config = new DocumentBuilder()
|
|
.setTitle('DCB webhook service')
|
|
.setDescription(
|
|
'This is a service dedicated to the reception of callback from external source and sending to rabbitMQ',
|
|
)
|
|
.setVersion('1.0')
|
|
.build();
|
|
|
|
const document = SwaggerModule.createDocument(app, config);
|
|
SwaggerModule.setup('api/docs', app, document);
|
|
|
|
await app.listen(process.env.PORT ?? 3000);
|
|
console.log(`Application is running on: http://localhost:3000`);
|
|
console.log(`Swagger docs: http://localhost:3000/api/docs`);
|
|
|
|
}
|
|
bootstrap();
|