MCPcopy
hub / github.com/fastify/fastify / basic404

Function basic404

lib/four-oh-four.js:54–66  ·  view source on GitHub ↗
(request, reply)

Source from the content-addressed store, hash-verified

52 }
53
54 function basic404 (request, reply) {
55 const { url, method } = request.raw
56 const message = `Route ${method}:${url} not found`
57 const resolvedDisableRequestLogging = typeof disableRequestLogging === 'function' ? disableRequestLogging(request.raw) : disableRequestLogging
58 if (!resolvedDisableRequestLogging) {
59 request.log.info(message)
60 }
61 reply.code(404).send({
62 message,
63 error: 'Not Found',
64 statusCode: 404
65 })
66 }
67
68 function createRouteEventHandler () {
69 return function onRouteEvent (path, req, res) {

Callers

nothing calls this directly

Calls 3

infoMethod · 0.80
sendMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected