📜  express static auth - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:50.890000             🧑  作者: Mango

代码示例1
app.use(function(req, res, next) {
    if (req.user == null && req.path.indexOf('/admin') === 0)
    {
        res.redirect('/login');
    }
    next(); 
});