dchege711 / dchege711/study_buddy
[Server] Use res.locals and app.locals instead of custom dicts
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
`res.locals` sets variables accessible in templates rendered with `res.render`. These variables are not shared between requests. [1] `app.locals` are also available in templates rendered with `res.render`, but these persist through out the lifetime of the app. [2]
Consider using these two utilities instead of the `getDefaultTemplateVars` pattern currently in use. [3]
[1]: https://expressjs.com/en/5x/api.html#res.locals
[2]: https://expressjs.com/en/5x/api.html#app.locals
[3]: https://github.com/dchege711/study_buddy/blob/464e421f7db189c660b9547621a6b3ee6c6eab96/src/controllers/ControllerUtilities.ts#L30
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.