@bbc/spartacus
Version:
19 lines (14 loc) • 626 B
JavaScript
const HelloWorld = {};
const getInitialData = {};
const serviceRegex = 'news|persian';
// this gets passed to universal-react-app which passes the regex on to react-router-config
export const regexPath = `/:service(${serviceRegex})/:id?`;
const routes = [
{
path: regexPath, // the path for react-router to match against with named params EG: :service
exact: true,
component: HelloWorld, // the component you want to render with the data from getInitialData
getInitialData, // a method which defines the URL to get data from and the params to pass through to the component
},
];
export default routes;