Merge pull request #800 from roramirez/test-set-MM_PORT

Test set mm port
This commit is contained in:
Michael Teeuw 2017-03-31 09:26:43 +02:00 committed by GitHub
commit 65d9e5d1fc
3 changed files with 29 additions and 1 deletions

View File

@ -57,6 +57,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added multiple calendar icon support.
- Added meta tags to support fullscreen mode on iOS (for server mode)
- Added `ignoreOldItems` and `ignoreOlderThan` options to the News Feed module
- Added test for MM_PORT enviroment variable.
- Added a configurable Week section to the clock module.
### Fixed
@ -68,6 +69,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.
- Fixed missing animation on `this.show(speed)` when module is alone in a region.
## [2.1.0] - 2016-12-31

View File

@ -17,7 +17,14 @@ var helmet = require("helmet");
var Server = function(config, callback) {
console.log("Starting server on 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);
if (config.ipWhitelist instanceof Array && config.ipWhitelist.length == 0) {
console.info("You're using a full whitelist configuration to allow for all IPs")

View File

@ -29,4 +29,23 @@ describe("port directive configuration", function () {
});
});
});
describe("Set port 8100 on enviroment variable MM_PORT", function () {
before(function() {
process.env.MM_PORT = 8100;
// Set config sample for use in this test
process.env.MM_CONFIG_FILE = "tests/configs/port_8090.js";
});
after(function(){
delete process.env.MM_PORT;
});
it("should return 200", function (done) {
request.get("http://localhost:8100", function (err, res, body) {
expect(res.statusCode).to.equal(200);
done();
});
});
});
});