这有效:
http://localhost:3000/private/test2.html
app.use('/private',express.static(path.join(__dirname, 'private')));
但是,一旦我添加中间件,就找不到该页面。
var secure = function(req,res,next) {
console.log('in here' + req.url);
next();
}
app.use('/private',secure,express.static(path.join(__dirname, 'private')));
有了中间件,我得到了 404。我在这里缺少什么?