Skip to main content
Module

x/oak/application.ts>Application#addEventListener

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
method Application.prototype.addEventListener
import { Application } from "https://deno.land/x/oak@v12.5.0/application.ts";

Add an event listener for a "close" event which occurs when the application is closed and no longer listening or handling requests.

Type Parameters

S extends AS

Parameters

type: "close"
listener: ApplicationCloseEventListenerOrEventListenerObject | null
optional
options: boolean | AddEventListenerOptions

Add an event listener for an "error" event which occurs when an un-caught error occurs when processing the middleware or during processing of the response.

Type Parameters

S extends AS

Parameters

type: "error"
listener: ApplicationErrorEventListenerOrEventListenerObject<S, AS> | null
optional
options: boolean | AddEventListenerOptions

Add an event listener for a "listen" event which occurs when the server has successfully opened but before any requests start being processed.

Parameters

type: "listen"
listener: ApplicationListenEventListenerOrEventListenerObject | null
optional
options: boolean | AddEventListenerOptions