From 77c365264045df0b2e84a050fb106f89d7392dc9 Mon Sep 17 00:00:00 2001 From: Oleg Shvartsman Date: Mon, 6 Mar 2023 15:49:56 +0000 Subject: [PATCH] Closes #1370, avoid requirement for self-hosted users to specify production environment --- CHANGELOG.md | 1 + apps/api/src/app/frontend.middleware.ts | 2 +- apps/api/src/main.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f64e93f2..0f4060e6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Removed the environment variable `ENABLE_FEATURE_CUSTOM_SYMBOLS` +- Changed the default `NODE_ENV` variable from `development` to `production` to avoid a requirement for self-hosted users to specify this value or receive `ENOENT: no such file or directory` error message on startup. ## 1.242.0 - 2023-03-04 diff --git a/apps/api/src/app/frontend.middleware.ts b/apps/api/src/app/frontend.middleware.ts index a43afa3f9..639c6bc3d 100644 --- a/apps/api/src/app/frontend.middleware.ts +++ b/apps/api/src/app/frontend.middleware.ts @@ -26,7 +26,7 @@ export class FrontendMiddleware implements NestMiddleware { ) { const NODE_ENV = this.configService.get<'development' | 'production'>('NODE_ENV') ?? - 'development'; + 'production'; this.isProduction = NODE_ENV === 'production'; diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index e53ade52c..81a33c231 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -12,7 +12,7 @@ async function bootstrap() { const NODE_ENV = configService.get<'development' | 'production'>('NODE_ENV') ?? - 'development'; + 'production'; const app = await NestFactory.create(AppModule, { logger: