mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 20:49:54 +00:00
replace ugly error message
This commit is contained in:
parent
5d29fa5e62
commit
f378c93dd3
11
js/server.js
11
js/server.js
@ -20,7 +20,16 @@ var Server = function(config, callback) {
|
||||
config.ipWhitelist = ['127.0.0.1', '::ffff:127.0.0.1'];
|
||||
console.log("Warning: Missing value (ipWhitelist) from config.js, assuming default (localhost access only): " + config.ipWhitelist);
|
||||
}
|
||||
app.use(ipfilter(config.ipWhitelist, {mode: 'allow', log: false}));
|
||||
|
||||
app.use(function(req, res, next) {
|
||||
var result = ipfilter(config.ipWhitelist, {mode: 'allow', log: false})(req, res, function(err) {
|
||||
if (err === undefined) {
|
||||
return next();
|
||||
}
|
||||
res.status(403).send("This device is not allowed to access your mirror. <br> Please check your config.js or config.js.sample to change this.");
|
||||
});
|
||||
});
|
||||
|
||||
app.use("/js", express.static(__dirname));
|
||||
app.use("/config", express.static(path.resolve(__dirname + "/../config")));
|
||||
app.use("/css", express.static(path.resolve(__dirname + "/../css")));
|
||||
|
Loading…
x
Reference in New Issue
Block a user