From 849b84ef0337c6dc51009a2f18af13ba9f0304bc Mon Sep 17 00:00:00 2001 From: Mayank Narula Date: Tue, 7 Nov 2017 12:36:41 +0530 Subject: [PATCH] Heroku set --- server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 2d9f53c..4c971f0 100644 --- a/server.js +++ b/server.js @@ -32,6 +32,8 @@ var transporter = nodemailer.createTransport({ } }); +app.set('port',process.env.port||5000); + function allValid(){ for (var i=0; i < arguments.length; i++) { if( arguments[i] == null || arguments[i] == undefined ){ @@ -315,4 +317,6 @@ app.get("/u/state",function(req,response){ pushSensorData(q.temp,q.humidity,q.light,q.inDoorMotion,q.outDoorMotion,q.ax,q.ay,q.az); } }); -app.listen(2300); +app.listen(app.get('port'),function(){ + console.log('Node app is running on port',app.get('port')); +}); \ No newline at end of file