node.js express needs to enter admin through adminlogin, otherwise it will not be able to access admin. How to write to jump directly to the adminlogin page?
Then there is another problem, that is, when entering /admin in the address bar, you must first jump to the /adminlogin page
Check the cookie before
admin
routing. If there is a valid cookie, continue the access. If not, jump toadminlogin
.To handle cookies, you can use
express-session
This library supports Redis and MongoDB.