From 05053381ef9fe6082d455097ac07429479314dcc Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Sun, 10 Sep 2023 14:35:15 -0300 Subject: [PATCH] fix: add HEROKU_ENV --- app.json | 4 ++++ src/config/env.config.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.json b/app.json index dab5216e..6c20dc1e 100644 --- a/app.json +++ b/app.json @@ -171,6 +171,10 @@ "AUTHENTICATION_JWT_SECRET": { "description": "The secret for jwt. (only for jwt authentication)", "generator": "secret" + }, + "HEROKU_ENV": { + "description": "Enable heroku env. (true/false) (only for heroku)", + "value": "true" } }, "formation": { diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 5f9b8f2f..5b157b84 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -161,7 +161,7 @@ export class ConfigService { } private loadEnv() { - this.env = !(process.env?.DOCKER_ENV === 'true') ? this.envYaml() : this.envProcess(); + this.env = !(process.env?.DOCKER_ENV === 'true') && !process.env?.HEROKU_ENV ? this.envYaml() : this.envProcess(); this.env.PRODUCTION = process.env?.NODE_ENV === 'PROD'; if (process.env?.DOCKER_ENV === 'true') { this.env.SERVER.TYPE = 'http';