| 1 | import { NestFactory } from '@nestjs/core'; |
| 2 | import { TicketsServiceModule } from './tickets-service.module'; |
| 3 | import { ValidationPipe } from '@nestjs/common'; |
| 4 | import { SERVICES_PORTS } from '@app/common'; |
| 5 | |
| 6 | async function bootstrap() { |
| 7 | const app = await NestFactory.create(TicketsServiceModule); |
| 8 | |
| 9 | //Enable validation |
| 10 | app.useGlobalPipes( |
| 11 | new ValidationPipe({ |
| 12 | whitelist: true, |
| 13 | transform: true, |
| 14 | forbidNonWhitelisted: true, |
| 15 | }), |
| 16 | ); |
| 17 | |
| 18 | await app.listen(SERVICES_PORTS.TICKETS_SERVICE); |
| 19 | console.log( |
| 20 | `Tickets Service is running on port ${SERVICES_PORTS.TICKETS_SERVICE}`, |
| 21 | ); |
| 22 | } |
| 23 | bootstrap(); |