fastify / point-of-view

Template rendering plugin for Fastify
MIT License
342 stars 86 forks source link

refactor: set nunjucks environment globals on load not per request #361

Closed gunjam closed 1 year ago

gunjam commented 1 year ago

The options callback for setting globals/filters on the nunjucks environment was being executed on request setting the same globals/filters over and over again. I've moved the code up to only execute on plugin load.

Don't think any new tests are needed.

Checklist