mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
21 lines
446 B
TypeScript
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';
|
|
|
|
class NotFoundHandler extends Handler {
|
|
async prepare() {
|
|
throw new NotFoundError();
|
|
}
|
|
|
|
async get() { }
|
|
|
|
async post() { }
|
|
}
|
|
|
|
export async function apply() {
|
|
Route('notfound', '*', NotFoundHandler);
|
|
}
|
|
|
|
global.Hydro.handler.notfound = apply;
|