Fix if MM_PORT enviroment variable is set

This commit is contained in:
Rodrigo Ramírez Norambuena 2017-03-10 18:20:11 -03:00
parent 4fdd12bc48
commit c282bb2fe1
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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) {