MCPcopy Create free account
hub / github.com/fastify/fastify / createRouteEventHandler

Function createRouteEventHandler

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

Source from the content-addressed store, hash-verified

63 }
64
65 function createRouteEventHandler () {
66 return function onRouteEvent (path, req, res) {
67 const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext]
68 const id = getGenReqId(fourOhFourContext.server, req)
69 const childLogger = createChildLogger(fourOhFourContext, logger, req, id)
70 const request = new Request(id, null, req, null, childLogger, fourOhFourContext)
71 const reply = new Reply(res, request, childLogger)
72
73 _routeEventHandler(request, reply)
74 }
75 }
76
77 function setContext (instance, context) {
78 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