Express the require = var ( 'Express'); var App = Express (); // login interception, if not logged in, part of the operation is disabled app.use (function (REQ, RES, Next) { IF (req.cookies.userId ) { Next (); // logged } the else { // whitelist // the console.log ( "req.originalUrl", req.originalUrl); IF (req.path == '/ Users / Login' REQ || == .path '/ Users / Zimbabwe Logout' || req.path == '/ Goods / List' || req.path == '/ Users / Register') { Next (); } the else { res.json ({ Status: '10001', MSG: 'currently logged', Result: '' }) } } })
A framework to express here the use of node