Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

express static auth

app.use(function(req, res, next) {
    if (req.user == null && req.path.indexOf('/admin') === 0)
    {
        res.redirect('/login');
    }
    next(); 
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #express #static #auth
ADD COMMENT
Topic
Name
9+8 =