From 5f2f102590ff1c141cf6aabd1d4f52eb9171a417 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 9 Feb 2024 20:29:24 +0000 Subject: [PATCH] Refactor expressSessionSecret to use environment variable if available --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index bd86842b..5b92b447 100644 --- a/src/app.ts +++ b/src/app.ts @@ -73,7 +73,7 @@ export class App { private async SetupApp() { dotenv.config(); - const expressSessionSecret = readFileSync(`${process.cwd()}/secret.txt`).toString(); + const expressSessionSecret = process.env.EXPRESS_SECRET || readFileSync(`${process.cwd()}/secret.txt`).toString(); this._app.set('views', path.join(process.cwd(), 'views')); this._app.set('view engine', 'pug');