简体   繁体   中英

Nodejs Expressjs, Pass data to all routes?

I was new in NodeJs by using ExpressJs framework. I have to create a login system and I want my html sidebar menu always show which user was login by looking from session and join to the database.

In laravel I can do it by using view composer . How I can do that in ExpressJs with AngulaJs for this case.

You need to create an authentication system. When a user logins for the first time, the data should be sent from server to client and then save somewhere in storage so the menu can identify which user is logged in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM