{"action":"created","issue":{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/308","labels_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/308/comments","events_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/308/events","html_url":"https://github.com/kriasoft/react-starter-kit/issues/308","id":115110182,"number":308,"title":"Any help / turorials on how the router works in this specific kit?","user":{"login":"AlastairTaft","id":3320742,"avatar_url":"https://avatars.githubusercontent.com/u/3320742?v=3","gravatar_id":"","url":"https://api.github.com/users/AlastairTaft","html_url":"https://github.com/AlastairTaft","followers_url":"https://api.github.com/users/AlastairTaft/followers","following_url":"https://api.github.com/users/AlastairTaft/following{/other_user}","gists_url":"https://api.github.com/users/AlastairTaft/gists{/gist_id}","starred_url":"https://api.github.com/users/AlastairTaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlastairTaft/subscriptions","organizations_url":"https://api.github.com/users/AlastairTaft/orgs","repos_url":"https://api.github.com/users/AlastairTaft/repos","events_url":"https://api.github.com/users/AlastairTaft/events{/privacy}","received_events_url":"https://api.github.com/users/AlastairTaft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/labels/ready","name":"ready","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-11-04T17:52:19Z","updated_at":"2016-01-14T15:13:52Z","closed_at":null,"body":"It seems to be that the router in this project isn't configured the same standard way all the tutorials and documentation out there do.\r\n\r\ne.g. server.js uses a dispatch event, I can't find any sample code elsewhere that uses this method, even in the API docs for react-router.\r\n```\r\nserver.get('*', async (req, res, next) => {\r\n    ...\r\n\r\n    await Router.dispatch({ path: req.path, context }, (state, component) => {\r\n      data.body = ReactDOM.renderToString(component);\r\n      data.css = css.join('');\r\n    });\r\n\r\n    const html = ReactDOM.renderToStaticMarkup(<Html {...data} />);\r\n    res.status(statusCode).send('<!doctype html>\\n' + html);\r\n\r\n  ...\r\n});\r\n```\r\n\r\nI'm trying to configure the router to load routes lazily in a similar way to [this example project](https://github.com/rackt/react-router/tree/master/examples/huge-apps).\r\n\r\nIn that huge-apps example code you can asynchonouly chose which routes to load in a route config\r\n\r\n```\r\nmodule.exports = {\r\n  path: 'course/:courseId',\r\n  \r\n  getChildRoutes(location, cb) {\r\n    require.ensure([], (require) => {\r\n      cb(null, [\r\n        require('./routes/Announcements'),\r\n        require('./routes/Assignments'),\r\n        require('./routes/Grades')\r\n      ])\r\n    })\r\n  },\r\n\r\n  ...\r\n}\r\n```\r\n\r\nI can't figure out how to apply the same thing to the way routing is done in this starter kit, anyone got similar experiences or can share their knowledge?\r\n"},"comment":{"url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/comments/171668729","html_url":"https://github.com/kriasoft/react-starter-kit/issues/308#issuecomment-171668729","issue_url":"https://api.github.com/repos/kriasoft/react-starter-kit/issues/308","id":171668729,"user":{"login":"xugy0926","id":3000884,"avatar_url":"https://avatars.githubusercontent.com/u/3000884?v=3","gravatar_id":"","url":"https://api.github.com/users/xugy0926","html_url":"https://github.com/xugy0926","followers_url":"https://api.github.com/users/xugy0926/followers","following_url":"https://api.github.com/users/xugy0926/following{/other_user}","gists_url":"https://api.github.com/users/xugy0926/gists{/gist_id}","starred_url":"https://api.github.com/users/xugy0926/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xugy0926/subscriptions","organizations_url":"https://api.github.com/users/xugy0926/orgs","repos_url":"https://api.github.com/users/xugy0926/repos","events_url":"https://api.github.com/users/xugy0926/events{/privacy}","received_events_url":"https://api.github.com/users/xugy0926/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T15:13:52Z","updated_at":"2016-01-14T15:13:52Z","body":"+1"}}