Returns a response with a status code 404 (Not Found) and instructs the router to show a 404 page.
The notFound()
function is used in the router()
, beforeRouter()
,
and afterRouter()
hooks to indicate that the requested page
was not found. Optionally, you can pass a message that otherwise defaults to
"Not Found".
function notFound(message: string): Promise<WixRouterResponse>;
The message to show.
import { notFound } from "wix-router";
export function myRouter_Router(request) {
return notFound();
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.