res locals fastify

Solutions on MaxInterview for res locals fastify by the best coders in the world

showing results for - "res locals fastify"
Maeve
29 Jan 2020
1fastify
2  .get('/', function (request, reply) {
3  	// display from view
4  	request.req.locals.title = "Hello Wordl";
5  })
Valentín
22 Jan 2020
1fastify.addHook('onRequest', (req, res, next) => {
2  req.locals = {}
3  next()
4})
5
6fastify.use('/', (req, res, next) => {
7  req.locals.a = 1
8  next()
9})
10
11fastify
12  .get('/', function (request, reply) {
13    reply
14      .send(request.req.locals)
15  })
queries leading to this page
res locals fastifyres locals fastify