MCPcopy
hub / github.com/fastify/fastify / createRouteEventHandler

Function createRouteEventHandler

lib/four-oh-four.js:68–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 function createRouteEventHandler () {
69 return function onRouteEvent (path, req, res) {
70 const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext]
71 const id = getGenReqId(fourOhFourContext.server, req)
72 const childLogger = createChildLogger(fourOhFourContext, logger, req, id)
73 const request = new Request(id, null, req, null, childLogger, fourOhFourContext)
74 const reply = new Reply(res, request, childLogger)
75
76 _routeEventHandler(request, reply)
77 }
78 }
79
80 function setContext (instance, context) {
81 const _404Context = Object.assign({}, instance[kFourOhFourContext])

Callers 1

fourOhFourFunction · 0.85

Calls 2

getGenReqIdFunction · 0.85
createChildLoggerFunction · 0.85

Tested by

no test coverage detected