{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4632","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4632/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4632/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4632/events","html_url":"https://github.com/Automattic/wp-calypso/pull/4632","id":147162875,"number":4632,"title":"Server-side Rendering: Route based on sections whitelist, fall back to 404","user":{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Framework","name":"Framework","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"ockham","id":96308,"avatar_url":"https://avatars.githubusercontent.com/u/96308?v=3","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-04-09T20:53:13Z","updated_at":"2016-04-09T21:35:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/4632","html_url":"https://github.com/Automattic/wp-calypso/pull/4632","diff_url":"https://github.com/Automattic/wp-calypso/pull/4632.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/4632.patch"},"body":"Use paths from `client/sections` for routing, and fall back to a 404 otherwise.\r\nAlso, use express middleware to add chunk `<script>` to HTML output (instead of manually testing RegEx compiled from `client/sections` path).\r\n\r\nBefore (http://calypso.localhost:3000/noexiste):\r\n\r\n![before](https://cloud.githubusercontent.com/assets/96308/14406354/8be6fd5e-fea5-11e5-9587-c13930492f03.png)\r\n\r\nAfter (http://calypso.localhost:3000/noexiste):\r\n\r\n![after](https://cloud.githubusercontent.com/assets/96308/14406356/9394482c-fea5-11e5-80fe-cc4c41166e93.png)\r\n\r\n\r\nTo test:\r\n* Try directly landing on different sections of Calypso and make sure they still work.\r\n * Check page source to see if there is a `<script>` for the corresponding chunk (e.g. for `/pages`, watch out for `<script src=\"/calypso/posts-pages.fb43c97d94c0abab7702.js\">`) -- except for `/design`, that's a known bug present in `master`, too.\r\n * Verify that server side rendering of theme sheets still works, e.g. http://calypso.localhost:3000/theme/prosperity/details (you might have to reload once because of an empty server-side cache)\r\n* Try directly landing on a route that doesn't exist, and verify that you get a 404.\r\n\r\n/CCing potentially interested parties @mtias @aduth @lamosty\r\n@folletto -- do we need any more styling for the 404s?"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/207856534","html_url":"https://github.com/Automattic/wp-calypso/pull/4632#issuecomment-207856534","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/4632","id":207856534,"user":{"login":"folletto","id":4389,"avatar_url":"https://avatars.githubusercontent.com/u/4389?v=3","gravatar_id":"","url":"https://api.github.com/users/folletto","html_url":"https://github.com/folletto","followers_url":"https://api.github.com/users/folletto/followers","following_url":"https://api.github.com/users/folletto/following{/other_user}","gists_url":"https://api.github.com/users/folletto/gists{/gist_id}","starred_url":"https://api.github.com/users/folletto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folletto/subscriptions","organizations_url":"https://api.github.com/users/folletto/orgs","repos_url":"https://api.github.com/users/folletto/repos","events_url":"https://api.github.com/users/folletto/events{/privacy}","received_events_url":"https://api.github.com/users/folletto/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T21:35:24Z","updated_at":"2016-04-09T21:35:24Z","body":">  do we need any more styling for the 404s?\r\n\r\nThat's the current correct 404 for Calypso, so it's fine. In that way any future iteration for it will appear properly. :)"}}