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.
20 lines
589 B
JavaScript
20 lines
589 B
JavaScript
5 years ago
|
const { Route, Handler } = require('../service/server');
|
||
|
const { NotFoundError } = require('../error');
|
||
|
|
||
|
class NotFoundHandler extends Handler {
|
||
|
async prepare() {
|
||
|
throw new NotFoundError();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
async function apply() {
|
||
|
Route('/:param1', module.exports.NotFoundHandler);
|
||
|
Route('/:param1/:param2', module.exports.NotFoundHandler);
|
||
|
Route('/:param1/:param2/:param3', module.exports.NotFoundHandler);
|
||
|
Route('/:param1/:param2/:param3/:param4', module.exports.NotFoundHandler);
|
||
|
}
|
||
|
|
||
|
global.Hydro.handler.notfound = module.exports = {
|
||
|
NotFoundHandler, apply,
|
||
|
};
|