INNER CODE UNIT · TypeScript

bootstrap

DenzelCode/nest-auth · src/main.ts:11

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);

  app.enableCors();
  app.enableShutdownHooks();
  app.set('trust proxy', environments.proxyEnabled);

  if (redis.enabled) {
    app.useWebSocketAdapter(new RedisIoAdapter(redis.host, redis.port, app));
  } else {
    app.useWebSocketAdapter(new CustomSocketIoAdapter(app));
  }

  const port = environments.port;
  const logger = new Logger('NestApplication');

  await app.listen(port, () => logger.log(`Server initialized on port ${port}`));
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…