{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/express/issues/2735","labels_url":"https://api.github.com/repos/strongloop/express/issues/2735/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/express/issues/2735/comments","events_url":"https://api.github.com/repos/strongloop/express/issues/2735/events","html_url":"https://github.com/strongloop/express/issues/2735","id":101532031,"number":2735,"title":"Express and Angular's html5Mode","user":{"login":"OKNoah","id":3739277,"avatar_url":"https://avatars.githubusercontent.com/u/3739277?v=3","gravatar_id":"","url":"https://api.github.com/users/OKNoah","html_url":"https://github.com/OKNoah","followers_url":"https://api.github.com/users/OKNoah/followers","following_url":"https://api.github.com/users/OKNoah/following{/other_user}","gists_url":"https://api.github.com/users/OKNoah/gists{/gist_id}","starred_url":"https://api.github.com/users/OKNoah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OKNoah/subscriptions","organizations_url":"https://api.github.com/users/OKNoah/orgs","repos_url":"https://api.github.com/users/OKNoah/repos","events_url":"https://api.github.com/users/OKNoah/events{/privacy}","received_events_url":"https://api.github.com/users/OKNoah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/express/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-17T23:39:31Z","updated_at":"2015-12-05T17:58:14Z","closed_at":"2015-10-19T13:47:29Z","body":"I've been trying to use Node and Express with Angular's `html5Mode` enabled. I keep running into problems. \r\n\r\nHere is the first one: http://stackoverflow.com/questions/31327439/angular-routing-in-html5mode-with-node-js\r\n\r\nAnd here is the latest one: http://stackoverflow.com/questions/32044247/node-express-gives-two-responses-breaks-front-end-script\r\n\r\nIn short, I am currently trying to detect Facebook's user agent and reroute the traffic. I enabled html5Mode so I could route the URL's properly without the hashtag (`#`) being in the URL. But some errors occur depending on how this is configured, such as the page saying `Cannot GET /.../...` when I refresh the page, or the page loading twice which breaks Mixpanel and the site."},"comment":{"url":"https://api.github.com/repos/strongloop/express/issues/comments/162231044","html_url":"https://github.com/strongloop/express/issues/2735#issuecomment-162231044","issue_url":"https://api.github.com/repos/strongloop/express/issues/2735","id":162231044,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T17:58:14Z","updated_at":"2015-12-05T17:58:14Z","body":"Hi @OKNoah , to me, that sounds like you want to add the following as probably the last route:\r\n```js\r\napp.get('*', function (req, res) {\r\n  res.sendFile('/path/to/your/index.html');\r\n});\r\n```"}}