From c8344dd03f7c514703a3b1c65aee03c7e75ec22c Mon Sep 17 00:00:00 2001 From: talksik Date: Mon, 6 Jul 2020 12:45:32 -0700 Subject: [PATCH] making changes for heroku server --- README.md | 5 +++-- server.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7389db5..eff603a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# tinder for jobs - +# Instructions to Run + +`node server.js` which will serve the static files diff --git a/server.js b/server.js index 8d4d7a9..1d046ed 100644 --- a/server.js +++ b/server.js @@ -8,7 +8,7 @@ app.use('/css', express.static(__dirname + '/public/css')); app.use('/js', express.static(__dirname + '/public/js')); app.use('/images', express.static(__dirname + '/public/images')); -var server = app.listen(8081, function () { - var port = server.address().port; +const port = server.address().port || 8081; +var server = app.listen(port, function () { console.log('Server started at http://localhost:%s', port); });