-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrouterBase.js
More file actions
34 lines (31 loc) · 793 Bytes
/
routerBase.js
File metadata and controls
34 lines (31 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* @typedef {import("./routerBase").Route} RouterBase.Route
*/
// MARK: class RouterBase
/**
* The base class for a router class.
* @abstract
*/
class RouterBase {
// MARK: static get route
/**
* Retrieves the route parameters for the class.
* @abstract
* @returns {RouterBase.Route} The route parameters.
*/
static get route() {
if (!Object.hasOwn(this, "route")) {
throw new Error(`You must implement the route property for ${this.name}.`);
}
return {
include: false,
catchAll: false,
webSocket: false,
notFound: false,
methodNotAllowed: false,
serverError: false,
middleware: []
};
}
}
module.exports = RouterBase;