-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathapp.ts
60 lines (51 loc) · 1.42 KB
/
app.ts
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
49
50
51
52
53
54
55
56
57
58
59
60
import {RouteConfig, Router, ConfiguresRouter, RouterConfiguration} from "aurelia-router";
import {PLATFORM, bindable, autoinject} from "aurelia-framework";
import {RouteMapper} from "./resources/services/route-mapper.service";
import environment from "./environment";
@autoinject()
export class App implements ConfiguresRouter {
public static Routes: RouteConfig[] = [
{
route: "/",
name: "home",
redirect: "pools/straks1/"
},
{
route: ['pools/'],
name: 'pools',
moduleId: PLATFORM.moduleName('./pools/pools'),
nav: true,
title: 'Pools',
settings: {}
},
{
route: ['pools/:id/:miner?'],
name: 'pool',
moduleId: PLATFORM.moduleName('./pool/pool'),
nav: false,
title: 'Pool',
settings: {}
},
{
route: ['status/'],
name: 'status',
moduleId: PLATFORM.moduleName('./status/status'),
nav: true,
title: 'Status',
settings: {}
}
];
@bindable
public router: Router;
constructor(private routeMapper: RouteMapper) {
}
public configureRouter(config: RouterConfiguration, router: Router): void | Promise<void> | PromiseLike<void> {
config.options.pushState = true;
config.title = "Gozo Pool";
const routes = App.Routes;
config.map(routes);
this.routeMapper.map(routes);
config.mapUnknownRoutes(PLATFORM.moduleName("./404/index"));
this.router = router;
}
}