{"action":"created","issue":{"url":"https://api.github.com/repos/teamfa/sails-universal-react-starter/issues/5","repository_url":"https://api.github.com/repos/teamfa/sails-universal-react-starter","labels_url":"https://api.github.com/repos/teamfa/sails-universal-react-starter/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/teamfa/sails-universal-react-starter/issues/5/comments","events_url":"https://api.github.com/repos/teamfa/sails-universal-react-starter/issues/5/events","html_url":"https://github.com/teamfa/sails-universal-react-starter/issues/5","id":165981563,"number":5,"title":"How do i switch to client side rendering","user":{"login":"saniko","id":1344142,"avatar_url":"https://avatars.githubusercontent.com/u/1344142?v=3","gravatar_id":"","url":"https://api.github.com/users/saniko","html_url":"https://github.com/saniko","followers_url":"https://api.github.com/users/saniko/followers","following_url":"https://api.github.com/users/saniko/following{/other_user}","gists_url":"https://api.github.com/users/saniko/gists{/gist_id}","starred_url":"https://api.github.com/users/saniko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saniko/subscriptions","organizations_url":"https://api.github.com/users/saniko/orgs","repos_url":"https://api.github.com/users/saniko/repos","events_url":"https://api.github.com/users/saniko/events{/privacy}","received_events_url":"https://api.github.com/users/saniko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-17T15:32:44Z","updated_at":"2016-07-19T10:20:43Z","closed_at":null,"body":"Is it modifying the the app.js\r\nglobal.__SERVER__ = true;\r\nglobal.__CLIENT__ = false;\r\n\r\nI would like to control the app isomorphism, but I'm not sure I'm changing the right params.\r\n\r\n:)\r\n"},"comment":{"url":"https://api.github.com/repos/teamfa/sails-universal-react-starter/issues/comments/233590878","html_url":"https://github.com/teamfa/sails-universal-react-starter/issues/5#issuecomment-233590878","issue_url":"https://api.github.com/repos/teamfa/sails-universal-react-starter/issues/5","id":233590878,"user":{"login":"Salakar","id":5347038,"avatar_url":"https://avatars.githubusercontent.com/u/5347038?v=3","gravatar_id":"","url":"https://api.github.com/users/Salakar","html_url":"https://github.com/Salakar","followers_url":"https://api.github.com/users/Salakar/followers","following_url":"https://api.github.com/users/Salakar/following{/other_user}","gists_url":"https://api.github.com/users/Salakar/gists{/gist_id}","starred_url":"https://api.github.com/users/Salakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Salakar/subscriptions","organizations_url":"https://api.github.com/users/Salakar/orgs","repos_url":"https://api.github.com/users/Salakar/repos","events_url":"https://api.github.com/users/Salakar/events{/privacy}","received_events_url":"https://api.github.com/users/Salakar/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T10:20:42Z","updated_at":"2016-07-19T10:20:42Z","body":"@saniko when a page is loaded first time via the browser - that comes from the server, subsequent requests that followed from links in your app are loaded client side. \r\n\r\nThis uses our sails react router hook internally, you can see the docs here: https://github.com/teamfa/sails-hook-react-router#config-api\r\n\r\nNote there is a routing preference option which you can set - which applies to all routes.\r\n\r\nThe globals you mentioned, namely: \r\n\r\n```javascript\r\nglobal.SERVER = true;\r\nglobal.CLIENT = false;\r\n```\r\n\r\nare not there for changing - you're meant to use them to detect if the current render is done on the server or client, i.e in your component render method.\r\n\r\nVery crude example (obviously you wouldn't get data in render but use comp lifecycle methods instead):\r\n\r\n\r\n```javascript\r\nclass Kittens extends Component {\r\n    render() {\r\n        if (SERVER) {\r\n             // do something server side specific i.e call your sails models for data\r\n        }\r\n\r\n        if (CLIENT) {\r\n            // we are on the client so no models available - call an api for data\r\n        }\r\n    }\r\n}"}}
{"actor":{"display_login":"Salakar"}}