MCPcopy
hub / github.com/fastify/fastify / bazInstance

Function bazInstance

test/genReqId.test.js:175–186  ·  view source on GitHub ↗
(instance, opts, next)

Source from the content-addressed store, hash-verified

173
174 t.after(() => fastify.close())
175 const bazInstance = function (instance, opts, next) {
176 instance.register(barInstance, { prefix: 'baz' })
177
178 instance.setGenReqId(function (req) {
179 return 'baz'
180 })
181 instance.get('/', (req, reply) => {
182 t.assert.ok(req.id)
183 reply.send({ id: req.id })
184 })
185 next()
186 }
187
188 const barInstance = function (instance, opts, next) {
189 instance.setGenReqId(function (req) {

Callers

nothing calls this directly

Calls 3

nextFunction · 0.85
setGenReqIdMethod · 0.80
sendMethod · 0.80

Tested by

no test coverage detected