diff --git a/CHANGELOG.md b/CHANGELOG.md index 1138da27..bdc8783b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Module currentWeather: check if temperature received from api is defined. - Fix an issue with module hidden status changing to `true` although lock string prevented showing it - Fix newsfeed module bug (removeStartTags) +- Fix when is set MM_PORT enviroment variable. ## [2.1.0] - 2016-12-31 diff --git a/js/server.js b/js/server.js index 901e0350..53d00235 100644 --- a/js/server.js +++ b/js/server.js @@ -15,9 +15,15 @@ var fs = require("fs"); var helmet = require("helmet"); var Server = function(config, callback) { - console.log("Starting server op port " + config.port + " ... "); - server.listen(config.port, config.address ? config.address : null); + var port = config.port; + if (process.env.MM_PORT) { + port = process.env.MM_PORT; + } + + console.log("Starting server op port " + port + " ... "); + + server.listen(port, config.address ? config.address : null); app.use(function(req, res, next) { var result = ipfilter(config.ipWhitelist, {mode: "allow", log: false})(req, res, function(err) {