create-fastify-app
Version:
A Fastify application generator
17 lines (13 loc) • 493 B
JavaScript
const fp = require('fastify-plugin')
module.exports = fp(async (fastify, opts) => {
fastify.addHook('onSend', async (request, reply) => {
// Notice: the next callback is not available when using async/await
// or returning a Promise. If you do invoke a next callback in this
// situation unexpected behavior may occur, e.g. duplicate invocation
// of handlers.
})
// fastify.addHook('onSend', (request, reply, payload, done) => {
// next()
// })
})