Skip to content

Commit

Permalink
Refactor expressSessionSecret to use environment variable if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Vylpes committed Feb 9, 2024
1 parent 0c7ba29 commit 5f2f102
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 5f2f102

Please sign in to comment.