Search...
notFound( )
Returns a response with a status code 404 (Not Found) and instructs the router to show a 404 page.
Description
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".
Authorization
Request
This endpoint does not take any parameters
Response Object
Fulfilled - A response object with HTTP status code 404.
Returns an empty object.
Status/Error Codes
Related Content:
Was this helpful?
Create a not found response
Copy Code
1import {notFound} from 'wix-router';23export function myRouter_Router(request) {45 return notFound();6}