22 lines
492 B
TypeScript
22 lines
492 B
TypeScript
import { ValidationPipe } from '@nestjs/common';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
|
|
declare const module: any;
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
|
|
app.enableShutdownHooks();
|
|
|
|
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
|
|
|
|
await app.listen(3000);
|
|
|
|
if (module.hot) {
|
|
module.hot.accept();
|
|
module.hot.dispose(() => app.close());
|
|
}
|
|
}
|
|
bootstrap();
|