Skip to content

Instantly share code, notes, and snippets.

@hnakao
Created November 11, 2020 21:30
Show Gist options
  • Save hnakao/cc5273872f3996fb6c88a001a172e1ea to your computer and use it in GitHub Desktop.
Save hnakao/cc5273872f3996fb6c88a001a172e1ea to your computer and use it in GitHub Desktop.
async function bootstrap() {
const app = await NestFactory.create(AppModule, { cors: true });
const configService: ConfigService = app.get(ConfigService);
app.setGlobalPrefix('/api/' + configService.get('APP_VERSION'));
app.useGlobalFilters(new HttpExceptionFilter());
app.use(bodyParser.json({ limit: '5mb' }));
app.use(bodyParser.urlencoded({ limit: '5mb', extended: true }));
Sentry.init({
dsn: configService.get('SENTRY_DSN'),
environment: configService.getEnvironment(),
});
await app.listen(configService.get('APP_PORT'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment