From 3cfe839c3e67fac7d527a48008951618ccb49038 Mon Sep 17 00:00:00 2001 From: Nareshkumar Rao Date: Sun, 25 Jul 2021 22:20:34 +0200 Subject: [PATCH] port set by appengine --- app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index 688a7d8..e1fc111 100644 --- a/app.js +++ b/app.js @@ -182,11 +182,11 @@ app.post('/create', (req, res) => { req.session.cookie.expires = cookieExpiry; req.session.user = reqEmail; res.cookie("authorized", success, { domain: process.env.COOKIE_DOMAIN.split(","), sameSite: "none", secure: true, expires: cookieExpiry }); - if(success){ - addContact(req.session.user, req.session.verifiedBy, (sucesss, msg)=>{ - res.send({ success: success, message: msg }); + if (success) { + addContact(req.session.user, req.session.verifiedBy, (sucesss, msg) => { + res.send({ success: success, message: msg }); }); - }else{ + } else { res.send({ success: success, message: msg }); } }); @@ -235,7 +235,7 @@ app.get("/verify/:id", (req, res) => { }); }); -const port = process.env.SERVER_PORT; +const port = process.env.PORT || 8080; app.listen(port, () => { console.log(`Listening on port ${port}`);