Answers for "res.locals fastify"

0

res.locals fastify

fastify
  .get('/', function (request, reply) {
  	// display from view
  	request.req.locals.title = "Hello Wordl";
  })
Posted by: Guest on May-16-2020
0

res.locals fastify

fastify.addHook('onRequest', (req, res, next) => {
  req.locals = {}
  next()
})

fastify.use('/', (req, res, next) => {
  req.locals.a = 1
  next()
})

fastify
  .get('/', function (request, reply) {
    reply
      .send(request.req.locals)
  })
Posted by: Guest on May-16-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language