From c7bc0a3829cddb6096b4772d7d3fabda59c7549f Mon Sep 17 00:00:00 2001 From: PPInfy <56343352+PPInfy@users.noreply.github.com> Date: Sun, 4 Oct 2020 01:50:24 +0530 Subject: [PATCH 1/2] CrossEnv changes to make port env agnostic to make PORT env agnostic. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 43982f9..20b2afd 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,13 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start": "node index" + "start": "cross-env PORT=8080 node index" }, "author": "", "license": "ISC", "dependencies": { "body-parser": "^1.19.0", + "cross-env": "^7.0.2", "express": "^4.17.1", "nodemon": "^2.0.4", "opn": "^6.0.0" From 0cbd5c9aab001407e4d026c8c34cd38157bf7e65 Mon Sep 17 00:00:00 2001 From: PPInfy <56343352+PPInfy@users.noreply.github.com> Date: Sun, 4 Oct 2020 14:21:28 +0530 Subject: [PATCH 2/2] to Show Port on which app is running --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 64abb73..eb86824 100644 --- a/index.js +++ b/index.js @@ -22,5 +22,5 @@ app.get('/digitalRain.js', (req, res) => res.sendFile( __dirname + '/DigitalRain app.get('/Digital-Rain', (req, res) => res.sendFile( __dirname + '/DigitalRain/digitalRain.html')); app.listen(PORT, function(req, res) { - console.log('Server running'); + console.log(`Server running on port ${PORT}`); });