-
Notifications
You must be signed in to change notification settings - Fork 400
/
Copy pathroutes.js
56 lines (52 loc) · 2.76 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
import config from 'config';
import React from 'react';
import { IndexRoute, Route } from 'react-router';
import SimulateAsyncError from
'core/containers/error-simulation/SimulateAsyncError';
import SimulateClientError from
'core/containers/error-simulation/SimulateClientError';
import SimulateSyncError from
'core/containers/error-simulation/SimulateSyncError';
import HandleLogin from 'core/containers/HandleLogin';
import AddonReviewList from './components/AddonReviewList';
import App from './containers/App';
import CategoryList from './containers/CategoryList';
import CategoryPage from './containers/CategoryPage';
import FeaturedAddons from './components/FeaturedAddons';
import LandingPage from './components/LandingPage';
import Home from './containers/Home';
import DetailPage from './containers/DetailPage';
import NotAuthorized from './components/ErrorPage/NotAuthorized';
import NotFound from './components/ErrorPage/NotFound';
import SearchPage from './containers/SearchPage';
import ServerError from './components/ErrorPage/ServerError';
export default (
<Route path="/:lang/:application" component={App}>
<IndexRoute component={Home} />
<Route path="addon/:slug/" component={DetailPage} />
<Route path="addon/:addonSlug/reviews/" component={AddonReviewList} />
{/* These user routes are to make the proxy serve each URL from */}
{/* addons-server until we can fix the :visibleAddonType route below. */}
{/* https://github.com/mozilla/addons-frontend/issues/2029 */}
{/* We are mimicing these URLs: https://github.com/mozilla/addons-server/blob/master/src/olympia/users/urls.py#L20 */}
<Route path="users/:userAction" component={NotFound} />
<Route path="users/:userAction/" component={NotFound} />
{/* https://github.com/mozilla/addons-frontend/issues/1975 */}
<Route path="user/:user/" component={NotFound} />
<Route path=":visibleAddonType/categories/" component={CategoryList} />
<Route path=":visibleAddonType/featured/" component={FeaturedAddons} />
<Route path=":visibleAddonType/:slug/" component={CategoryPage} />
<Route path="/api/v3/accounts/authenticate/" component={HandleLogin} />
<Route path="search/" component={SearchPage} />
<Route path="401/"
component={config.get('isDevelopment') ? NotAuthorized : NotFound} />
<Route path="404/" component={NotFound} />
<Route path="500/"
component={config.get('isDevelopment') ? ServerError : NotFound} />
<Route path="simulate-async-error/" component={SimulateAsyncError} />
<Route path="simulate-sync-error/" component={SimulateSyncError} />
<Route path="simulate-client-error/" component={SimulateClientError} />
<Route path=":visibleAddonType/" component={LandingPage} />
<Route path="*" component={NotFound} />
</Route>
);