1 | ;
|
2 |
|
3 | class KellnerRoute {
|
4 | constructor(route) {
|
5 | if (typeof route === 'string') {
|
6 | this.path = route;
|
7 | this.name = route;
|
8 | } else {
|
9 | if (!('path' in route))
|
10 | throw new Error('KellnerRoute must have atleat a path');
|
11 | this.path = route.path;
|
12 | this.name = route.name || this.path;
|
13 | }
|
14 | }
|
15 | }
|
16 |
|
17 | KellnerRoute.rootRoute = new KellnerRoute('');
|
18 |
|
19 | module.exports = KellnerRoute;
|