From e609fb29c309f68d89e72c670bbf63f42aa578f4 Mon Sep 17 00:00:00 2001 From: Ian Ramzy Date: Mon, 23 Mar 2020 20:26:28 -0400 Subject: [PATCH] add detection of heroku port --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3928926..59d323b 100644 --- a/index.js +++ b/index.js @@ -78,7 +78,9 @@ io.on('connection', function (socket) { }); }); -http.listen(3000, function () { - console.log("http://localhost:3000"); + +port = process.env.PORT || 3000 +http.listen(port, function () { + console.log("http://localhost:"+port); });