You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/hydro/handler/notfound.ts

21 lines
446 B
TypeScript

/* eslint-disable no-empty-function */
/* eslint-disable class-methods-use-this */
import { NotFoundError } from '../error';
import { Route, Handler } from '../service/server';
5 years ago
class NotFoundHandler extends Handler {
async prepare() {
throw new NotFoundError();
5 years ago
}
async get() { }
async post() { }
5 years ago
}
export async function apply() {
Route('notfound', '*', NotFoundHandler);
5 years ago
}
global.Hydro.handler.notfound = apply;