From 8b3a8b8c9bd14744b44138fb5ce13772ad22199c Mon Sep 17 00:00:00 2001 From: JayWll Date: Sat, 11 Apr 2020 12:10:24 -0600 Subject: [PATCH] Adding fallback to port 4200 for development server --- nodeapp/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodeapp/app.js b/nodeapp/app.js index 1f45a35..6a3ea80 100644 --- a/nodeapp/app.js +++ b/nodeapp/app.js @@ -86,7 +86,7 @@ app.get('/exportall', (req, res) => { if (!req.headers['export-key'] || req.headers['export-key'] != process.env.SECRET) { return res.status(401).send('Authorization header not found').end(); } - + Readings.findAll().then((result) => { res.status(200).send(result).end(); }) @@ -117,6 +117,6 @@ app.get('/cleanup', (req, res) => { // listen for requests :) -const listener = app.listen(process.env.PORT, function() { +const listener = app.listen(process.env.PORT || 4200, function() { console.log("Your app is listening on port " + listener.address().port); });