-
Notifications
You must be signed in to change notification settings - Fork 228
/
index.js
43 lines (41 loc) · 1.08 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
import Article from '../containers/Article';
import FrontPage from '../containers/FrontPage';
import MediaPage from '../containers/MediaPage';
import ErrorPage from '../containers/Error';
import getArticleInitialData from './getInitialData/article';
import getFrontpageInitialData from './getInitialData/frontpage';
import getMediaPageInitialData from './getInitialData/mediapage';
import {
articleRegexPath,
frontpageRegexPath,
mediaRadioAndTvRegexPathsArray,
} from './regex';
const routes = [
{
path: articleRegexPath,
exact: true,
component: Article,
getInitialData: getArticleInitialData,
pageType: 'article',
},
{
path: frontpageRegexPath,
exact: true,
component: FrontPage,
getInitialData: getFrontpageInitialData,
pageType: 'frontPage',
},
{
path: mediaRadioAndTvRegexPathsArray,
exact: true,
component: MediaPage,
getInitialData: getMediaPageInitialData,
pageType: 'media',
},
{
component: ErrorPage,
getInitialData: () => Promise.resolve({ status: 404 }),
pageType: 'error',
},
];
export default routes;