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

Function defaultRoute

fastify.js:629–638  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

627 // If the router does not match any route, every request will land here
628 // req and res are Node.js core objects
629 function defaultRoute (req, res) {
630 if (req.headers['accept-version'] !== undefined) {
631 // we remove the accept-version header for performance result
632 // because we do not want to go through the constraint checking
633 // the usage of symbol here to prevent any collision on custom header name
634 req.headers[kRequestAcceptVersion] = req.headers['accept-version']
635 req.headers['accept-version'] = undefined
636 }
637 fourOhFour.router.lookup(req, res)
638 }
639
640 function onBadUrl (path, req, res) {
641 if (options.frameworkErrors) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected