From 4064be3280489862e4f83d5fae986a7d2c92426f Mon Sep 17 00:00:00 2001 From: flifloo Date: Sun, 26 Apr 2020 23:38:10 +0200 Subject: [PATCH] Better environment variable use --- app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index eaf9cfd..07026b1 100644 --- a/app.js +++ b/app.js @@ -29,9 +29,9 @@ if (!fs.existsSync("users.json")) { app.use(morgan("dev")) .use(express.static("public")) .use(bodyParser.urlencoded({ extended: true })) - .use(cookieParser(process.env.SECRET)) + .use(cookieParser(process.env.SECRET || "Keyboard cat")) .use(session({ - secret: process.env.SECRET, + secret: process.env.SECRET || "Keyboard cat", resave: false, saveUninitialized: false, cookie: { secure: "auto" } @@ -44,5 +44,5 @@ app.use(morgan("dev")) .use("/images", imagesRoute) .use(notFoundRoute) .use(errorRoute) - .listen(8080); + .listen(process.env.PORT || 8080);