| 1 | import { NestFactory } from '@nestjs/core'; |
| 2 | import { AuthServiceModule } from './auth-service.module'; |
| 3 | import { SERVICES_PORTS } from '@app/common'; |
| 4 | import { ValidationPipe } from '@nestjs/common'; |
| 5 | |
| 6 | async function bootstrap() { |
| 7 | const app = await NestFactory.create(AuthServiceModule); |
| 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.AUTH_SERVICE); |
| 19 | console.log(`Auth Service is running on port ${SERVICES_PORTS.AUTH_SERVICE}`); |
| 20 | } |
| 21 | bootstrap(); |