main.hmr.ts 345 B

123456789101112131415
  1. import { NestFactory } from '@nestjs/core';
  2. import { AppModule } from './app.module';
  3. declare const module: any;
  4. async function bootstrap() {
  5. const app = await NestFactory.create(AppModule);
  6. await app.listen(3000);
  7. if (module.hot) {
  8. module.hot.accept();
  9. module.hot.dispose(() => app.close());
  10. }
  11. }
  12. bootstrap();