mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
15 lines
386 B
JavaScript
15 lines
386 B
JavaScript
const { Route, Handler } = require('../service/server');
|
|
const { NotFoundError } = require('../error');
|
|
|
|
class NotFoundHandler extends Handler {
|
|
async prepare() { // eslint-disable-line class-methods-use-this
|
|
throw new NotFoundError();
|
|
}
|
|
}
|
|
|
|
async function apply() {
|
|
Route('notfound', '*', NotFoundHandler);
|
|
}
|
|
|
|
global.Hydro.handler.notfound = module.exports = apply;
|