19 lines
598 B
TypeScript
19 lines
598 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
import { ValidationPipe } from '@nestjs/common';
|
|
import { ConfigService } from '@nestjs/config';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
const cfg = app.get(ConfigService);
|
|
|
|
app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));
|
|
app.enableCors();
|
|
|
|
// Start the standalone transit API
|
|
const port = cfg.get<number>('PORT') || 4020;
|
|
await app.listen(port);
|
|
console.log(`Transit Microservice running on port ${port}`);
|
|
}
|
|
bootstrap();
|