How do you access 1 singleton on all routes with nodejs/express?

I have a singleton called "Global" with header & footer information. What would be the best way to access that singleton on all routes in app.js?

1 Like

Hello!

What frontend framework are you using?

1 Like

Hello. Its just a standard Express/Pug site.

Hey Tyler,

You could do that with a wildcard * query like we do for the menu singleton in our Node.js website example:

2 Likes

Thanks @Phil...that worked perfectly. Cheers!

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.