-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathroutes.js
64 lines (56 loc) · 1.54 KB
/
routes.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const routes = require('next-routes')(); // require statement here returns a function thus a parenthesis.
routes
.add({
name: 'createRootFund',
pattern: '/factory/rootFund/new',
page: '/factory/rootFund/new'
})
.add('/funds/requests', '/funds/requests')
.add({
name: 'fundDetails',
pattern: '/funds/:contractAddress',
page: '/funds/details'
})
.add({
name: 'getFundRequestsByChild',
pattern: '/funds/:contractAddress/requests/byChild',
page: '/funds/requests/byChild'
})
.add({
name: 'getFundRequestsByManager',
pattern: '/funds/:contractAddress/requests/byManager',
page: '/funds/requests/byManager'
})
.add({
name: 'getChildFunds',
pattern: '/funds/:contractAddress/children',
page: '/funds/children'
})
.add({
name: 'withdrawTokens',
pattern: '/funds/:contractAddress/children',
page: '/funds/children'
})
.add({
name:'graphVis',
pattern:'/graph-vis/graph',
page:'/graph-vis/graph'
});
module.exports = routes;
/*
### EXAMPLE ###
// Adding new route mapping
routes
.add('/campaigns/new', '/campaigns/new') // Added before as :address was taking 'new'RL.
.add('/campaigns/:address', '/campaigns/show')
.add('/campaigns/:address/requests', '/campaigns/requests/index')
.add('/campaigns/:address/requests/new', '/campaigns/requests/new');
// : represents wildcard
// arg1: the new route
// arg2: What component do we need to show.
*/
// module.exports = routes().add({
// name: 'fundDetails',
// pattern: '/funds/:contractAddress',
// page: '/funds/details'
// });