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.
19 lines
418 B
TypeScript
19 lines
418 B
TypeScript
4 years ago
|
/* eslint-disable no-empty-function */
|
||
|
/* eslint-disable class-methods-use-this */
|
||
4 years ago
|
import { NotFoundError } from '../error';
|
||
|
import { Route, Handler } from '../service/server';
|
||
5 years ago
|
|
||
|
class NotFoundHandler extends Handler {
|
||
4 years ago
|
async prepare() {
|
||
5 years ago
|
throw new NotFoundError();
|
||
5 years ago
|
}
|
||
4 years ago
|
|
||
4 years ago
|
all() { }
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
export async function apply() {
|
||
4 years ago
|
Route('notfound', '*', NotFoundHandler);
|
||
5 years ago
|
}
|
||
|
|
||
4 years ago
|
global.Hydro.handler.notfound = apply;
|