-
Notifications
You must be signed in to change notification settings - Fork 0
/
routerBase.js
48 lines (45 loc) · 1.47 KB
/
routerBase.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @typedef {import("./routerBase").Route} RouterBase.Route
*/
// #### # ####
// # # # # #
// # # ### # # #### ### # ## # # ### ### ###
// #### # # # # # # # ## # ### # # # #
// # # # # # # # ##### # # # #### ### #####
// # # # # # ## # # # # # # # # # #
// # # ### ## # ## ### # #### #### #### ###
/**
* The base class for a router class.
* @abstract
*/
class RouterBase {
// #
// #
// ### ## # # ### ##
// # # # # # # # # ##
// # # # # # # ##
// # ## ### ## ##
/**
* Retrieves the route parameters for the class.
* @abstract
* @returns {RouterBase.Route} The route parameters.
*/
static get route() {
if (!Object.prototype.hasOwnProperty.call(this, "route")) {
throw new Error(`You must implement the route property for ${this.name}.`);
}
return {
file: "",
lastModified: new Date(1970, 0, 1),
include: false,
webSocket: false,
events: [],
methods: [],
notFound: false,
methodNotAllowed: false,
serverError: false,
middleware: []
};
}
}
module.exports = RouterBase;