MCPcopy
hub / github.com/fastify/fastify / fooInstance

Function fooInstance

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

Source from the content-addressed store, hash-verified

197 }
198
199 const fooInstance = function (instance, opts, next) {
200 instance.register(bazInstance, { prefix: 'baz' })
201 instance.register(barInstance, { prefix: 'bar' })
202
203 instance.setGenReqId(function (req) {
204 return 'foo'
205 })
206
207 instance.get('/', (req, reply) => {
208 t.assert.ok(req.id)
209 reply.send({ id: req.id })
210 })
211 next()
212 }
213
214 fastify.register(fooInstance, { prefix: 'foo' })
215

Callers

nothing calls this directly

Calls 3

nextFunction · 0.85
setGenReqIdMethod · 0.80
sendMethod · 0.80

Tested by

no test coverage detected