fastify-pug
A plugin for fastify that adds support for the template engine pug.
Install
npm install fastify-pug
Usage
const fastify = ;const fastifyPug = ; const app = ;app; app; app
API
Options
views
- the relative path to the folder containing the views.fallbackViews
(optional) - a fallback directory for the views.filename
(optional) - for handling relative includes. Pass in a function like (view: string) =>src/${view}
reply.render(view [, locals])
Renders the template from the relative path view
. Allows to pass variables to the template via the locals
object.