Files
freeCodeCamp/common/app/routes/index.js
2016-07-28 23:40:01 -07:00

26 lines
564 B
JavaScript

import { modernChallenges, map, challenges } from './challenges';
import NotFound from '../components/NotFound/index.jsx';
import { addLang } from '../utils/lang';
import settings from './settings';
export default {
path: '/:lang',
indexRoute: {
onEnter(nextState, replace) {
const { lang } = nextState.params;
const { pathname } = nextState.location;
replace(addLang(pathname, lang));
}
},
childRoutes: [
challenges,
modernChallenges,
map,
settings,
{
path: '*',
component: NotFound
}
]
};