Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/acorn/router.ts>NotFoundEvent

A focused RESTful server framework for Deno 🌰🦕
Go to Latest
class NotFoundEvent
extends Event
import { NotFoundEvent } from "https://deno.land/x/acorn@0.5.0/router.ts";

A DOM like event that is emitted from the router when any request did not match any routes.

Setting the .response property will cause the default response to be overridden.

Constructors

new
NotFoundEvent(eventInitDict: NotFoundEventInit)

Properties

readonly
request: Request

The original Request associated with the event.

optional
response: Response

If the event listener whishes to issue a specific response to the event, then it should set the value here to a Response and the router will use it to respond.