fixed crash caused from mistyped url

This commit is contained in:
tigerbot 2017-06-12 11:39:02 -06:00
parent 4d49e0fb63
commit 651e53daf1
1 changed files with 6 additions and 2 deletions

View File

@ -337,8 +337,12 @@ module.exports = function (myDeps, conf, overrideHttp) {
, app: function (config, hostname, pathname, req, res, next) { , app: function (config, hostname, pathname, req, res, next) {
//var appfile = path.resolve(/*process.cwd(), */config.path.replace(/:hostname/, hostname)); //var appfile = path.resolve(/*process.cwd(), */config.path.replace(/:hostname/, hostname));
var appfile = config.path.replace(/:hostname/, hostname); var appfile = config.path.replace(/:hostname/, hostname);
try {
var app = require(appfile); var app = require(appfile);
app(req, res, next); app(req, res, next);
} catch (err) {
next();
}
} }
}; };