-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
77 lines (69 loc) · 1.97 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
/* eslint-disable global-require */
// The top-level (parent) route
const routes = {
path: '',
// Keep in mind, routes are evaluated in order
children: [
{
path: '',
load: () => import(/* webpackChunkName: 'home' */ './lte-test'),
},
{
path: '/contact',
load: () => import(/* webpackChunkName: 'contact' */ './contact'),
},
{
path: '/login',
load: () => import(/* webpackChunkName: 'login' */ './login'),
},
{
path: '/register',
load: () => import(/* webpackChunkName: 'register' */ './register'),
},
{
path: '/about',
load: () => import(/* webpackChunkName: 'about' */ './about'),
},
{
path: '/privacy',
load: () => import(/* webpackChunkName: 'privacy' */ './privacy'),
},
{
path: '/admin',
load: () => import(/* webpackChunkName: 'admin' */ './admin'),
},
{
path: '/lte-test',
load: () => import(/* webpackChunkName: 'lte-test' */ './lte-test'),
},
// Wildcard routes, e.g. { path: '(.*)', ... } (must go last)
{
path: '(.*)',
load: () => import(/* webpackChunkName: 'not-found' */ './not-found'),
},
],
async action({ next }) {
// Execute each child route until one of them return the result
const route = await next();
// Provide default values for title, description etc.
route.title = `${route.title || 'Untitled Page'} - www.reactstarterkit.com`;
route.description = route.description || '';
return route;
},
};
// The error page is available by permanent url for development mode
if (__DEV__) {
routes.children.unshift({
path: '/error',
action: require('./error').default,
});
}
export default routes;