@ -1,7 +1,6 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { NestExpressApplication } from '@nestjs/platform-express';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
import * as Sentry from '@sentry/node';
|
||||
import { graphqlUploadExpress } from 'graphql-upload';
|
||||
@ -14,15 +13,13 @@ import { AppModule } from './app.module';
|
||||
import { generateFrontConfig } from './utils/generate-front-config';
|
||||
import { settings } from './engine/constants/settings';
|
||||
import { LoggerService } from './engine/integrations/logger/logger.service';
|
||||
import { EnvironmentService } from './engine/integrations/environment/environment.service';
|
||||
|
||||
const bootstrap = async () => {
|
||||
const environmentService = new EnvironmentService(new ConfigService());
|
||||
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
|
||||
cors: true,
|
||||
bufferLogs: environmentService.get('LOGGER_IS_BUFFER_ENABLED'),
|
||||
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
|
||||
rawBody: true,
|
||||
snapshot: environmentService.get('DEBUG_MODE'),
|
||||
snapshot: process.env.DEBUG_MODE === 'true',
|
||||
});
|
||||
const logger = app.get(LoggerService);
|
||||
|
||||
@ -64,7 +61,7 @@ const bootstrap = async () => {
|
||||
// Create the env-config.js of the front at runtime
|
||||
generateFrontConfig();
|
||||
|
||||
await app.listen(app.get(EnvironmentService).get('PORT'));
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
};
|
||||
|
||||
bootstrap();
|
||||
|
||||
Reference in New Issue
Block a user