Browse Source

Closes #1370, avoid requirement for self-hosted users to specify production environment

pull/1773/head
Oleg Shvartsman 3 years ago
parent
commit
77c3652640
  1. 1
      CHANGELOG.md
  2. 2
      apps/api/src/app/frontend.middleware.ts
  3. 2
      apps/api/src/main.ts

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Removed the environment variable `ENABLE_FEATURE_CUSTOM_SYMBOLS` - 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 ## 1.242.0 - 2023-03-04

2
apps/api/src/app/frontend.middleware.ts

@ -26,7 +26,7 @@ export class FrontendMiddleware implements NestMiddleware {
) { ) {
const NODE_ENV = const NODE_ENV =
this.configService.get<'development' | 'production'>('NODE_ENV') ?? this.configService.get<'development' | 'production'>('NODE_ENV') ??
'development'; 'production';
this.isProduction = NODE_ENV === 'production'; this.isProduction = NODE_ENV === 'production';

2
apps/api/src/main.ts

@ -12,7 +12,7 @@ async function bootstrap() {
const NODE_ENV = const NODE_ENV =
configService.get<'development' | 'production'>('NODE_ENV') ?? configService.get<'development' | 'production'>('NODE_ENV') ??
'development'; 'production';
const app = await NestFactory.create(AppModule, { const app = await NestFactory.create(AppModule, {
logger: logger:

Loading…
Cancel
Save