Skip to main content

MiddlewareFactory.notFound()

Home > @backstage/backend-app-api > MiddlewareFactory > notFound

Returns a middleware that unconditionally produces a 404 error response.

Signature:

notFound(): RequestHandler;

Returns:

RequestHandler

An Express request handler

Remarks

Typically you want to place this middleware at the end of the chain, such that it's the last one attempted after no other routes matched.