{"action":"created","issue":{"url":"https://api.github.com/repos/ethanresnick/json-api-example/issues/12","repository_url":"https://api.github.com/repos/ethanresnick/json-api-example","labels_url":"https://api.github.com/repos/ethanresnick/json-api-example/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/ethanresnick/json-api-example/issues/12/comments","events_url":"https://api.github.com/repos/ethanresnick/json-api-example/issues/12/events","html_url":"https://github.com/ethanresnick/json-api-example/issues/12","id":225359948,"number":12,"title":"OPTION CORS not allowed","user":{"login":"docsa","id":25287625,"avatar_url":"https://avatars3.githubusercontent.com/u/25287625?v=3","gravatar_id":"","url":"https://api.github.com/users/docsa","html_url":"https://github.com/docsa","followers_url":"https://api.github.com/users/docsa/followers","following_url":"https://api.github.com/users/docsa/following{/other_user}","gists_url":"https://api.github.com/users/docsa/gists{/gist_id}","starred_url":"https://api.github.com/users/docsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docsa/subscriptions","organizations_url":"https://api.github.com/users/docsa/orgs","repos_url":"https://api.github.com/users/docsa/repos","events_url":"https://api.github.com/users/docsa/events{/privacy}","received_events_url":"https://api.github.com/users/docsa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-30T22:43:35Z","updated_at":"2017-05-03T19:09:56Z","closed_at":null,"body":"I currently write an ember.js client for this API. \r\nbrowsers send an OPTIONS request before any access.\r\nCould you add those lines  after  line #45 in index.js ?\r\n\r\n```js\r\n  res.set('Access-Control-Allow-Origin', '*');\r\n  // add CORS compliance\r\n  res.set('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');\r\n  res.set('Access-Control-Allow-Headers', 'Content-Type, Accept, Authorization, Content-Length, X-Requested-With');\r\n\r\n// intercept OPTIONS method\r\nif ('OPTIONS' == req.method) {\r\n  res.send(200);\r\n}\r\nelse {\r\n  next();\r\n}\r\n````\r\n\r\n(I tried au pull request but i am not allowed to push)\r\nThanks \r\nAlain "},"comment":{"url":"https://api.github.com/repos/ethanresnick/json-api-example/issues/comments/299006642","html_url":"https://github.com/ethanresnick/json-api-example/issues/12#issuecomment-299006642","issue_url":"https://api.github.com/repos/ethanresnick/json-api-example/issues/12","id":299006642,"user":{"login":"ethanresnick","id":471894,"avatar_url":"https://avatars2.githubusercontent.com/u/471894?v=3","gravatar_id":"","url":"https://api.github.com/users/ethanresnick","html_url":"https://github.com/ethanresnick","followers_url":"https://api.github.com/users/ethanresnick/followers","following_url":"https://api.github.com/users/ethanresnick/following{/other_user}","gists_url":"https://api.github.com/users/ethanresnick/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanresnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanresnick/subscriptions","organizations_url":"https://api.github.com/users/ethanresnick/orgs","repos_url":"https://api.github.com/users/ethanresnick/repos","events_url":"https://api.github.com/users/ethanresnick/events{/privacy}","received_events_url":"https://api.github.com/users/ethanresnick/received_events","type":"User","site_admin":false},"created_at":"2017-05-03T19:09:55Z","updated_at":"2017-05-03T19:09:55Z","body":"Thanks for pointing this out Alain! Can you check out the code [in this branch](https://github.com/ethanresnick/json-api-example/tree/cors) and let me know if it works for your use case? If it does, i'll merge it in. I think it should be good, but I may have missed some CORS subtlety."}}
{"actor":{"display_login":"ethanresnick"}}