{"action":"created","issue":{"url":"https://api.github.com/repos/Aconex/drakov/issues/69","labels_url":"https://api.github.com/repos/Aconex/drakov/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/Aconex/drakov/issues/69/comments","events_url":"https://api.github.com/repos/Aconex/drakov/issues/69/events","html_url":"https://github.com/Aconex/drakov/issues/69","id":93681137,"number":69,"title":"Angular http service not responding","user":{"login":"shavo007","id":5466825,"avatar_url":"https://avatars.githubusercontent.com/u/5466825?v=3","gravatar_id":"","url":"https://api.github.com/users/shavo007","html_url":"https://github.com/shavo007","followers_url":"https://api.github.com/users/shavo007/followers","following_url":"https://api.github.com/users/shavo007/following{/other_user}","gists_url":"https://api.github.com/users/shavo007/gists{/gist_id}","starred_url":"https://api.github.com/users/shavo007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shavo007/subscriptions","organizations_url":"https://api.github.com/users/shavo007/orgs","repos_url":"https://api.github.com/users/shavo007/repos","events_url":"https://api.github.com/users/shavo007/events{/privacy}","received_events_url":"https://api.github.com/users/shavo007/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-08T03:17:49Z","updated_at":"2015-07-08T07:22:07Z","closed_at":null,"body":"Hi,\r\n\r\nI have drakov running using grunt on localhost:3000. \r\n\r\n```\r\n\r\n[LOG] Setup Route: GET /subscribe Subscribe by email\r\n   Drakov 0.1.8      Listening on port 3000\r\n-- STARTED --\r\n```\r\n\r\nMy endpoint I can hit via browser or postman.\r\n\r\nExample:\r\n\r\nhttp://localhost:3000/subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n\r\nBut when I try and call the api in angular, in the server console it logs continuously:\r\n```\r\n[LOG] OPTIONS /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n```\r\n\r\nCode snippet angular:\r\n\r\n```javascript\r\n\r\n $http.get('http://localhost:3000/subscribe?id=12345&type=xyz&email=xyz&hv=xyz', {headers: {\r\n        'Custom-Header': 'a'}})\r\n        .success(function (response) {\r\n          console.log('Response ' + response);\r\n        });\r\n\r\n```\r\n\r\nMy grunt config:\r\n\r\n```javascript\r\n grunt.registerTask('mock-api', 'Start drakov server', function() {\r\n    var done = this.async();\r\n\r\n    var drakovOptions = {\r\n      sourceFiles: './doc/*.md',\r\n      serverPort: 3000\r\n     // autoOptions: true\r\n      //disableCORS: false\r\n    };\r\n\r\n    drakov.run(drakovOptions, function(err){\r\n      console.log('-- STARTED --');\r\n      if (err) {\r\n        throw err;\r\n      }\r\n    });\r\n    done();\r\n  });\r\n```\r\n\r\nNB: My angular app is running on a different port using connect on port 9000."},"comment":{"url":"https://api.github.com/repos/Aconex/drakov/issues/comments/119466745","html_url":"https://github.com/Aconex/drakov/issues/69#issuecomment-119466745","issue_url":"https://api.github.com/repos/Aconex/drakov/issues/69","id":119466745,"user":{"login":"shavo007","id":5466825,"avatar_url":"https://avatars.githubusercontent.com/u/5466825?v=3","gravatar_id":"","url":"https://api.github.com/users/shavo007","html_url":"https://github.com/shavo007","followers_url":"https://api.github.com/users/shavo007/followers","following_url":"https://api.github.com/users/shavo007/following{/other_user}","gists_url":"https://api.github.com/users/shavo007/gists{/gist_id}","starred_url":"https://api.github.com/users/shavo007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shavo007/subscriptions","organizations_url":"https://api.github.com/users/shavo007/orgs","repos_url":"https://api.github.com/users/shavo007/repos","events_url":"https://api.github.com/users/shavo007/events{/privacy}","received_events_url":"https://api.github.com/users/shavo007/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T07:22:07Z","updated_at":"2015-07-08T07:22:07Z","body":"I have got a bit further but not much!\r\nIn the response I added in two headers:\r\n\r\n```\r\n+ Headers\r\n\r\n            Access-Control-Allow-Origin: *\r\n            Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept\r\n\r\n```\r\n\r\nAngular http service now calls get instead of options but it just keeps looping and inevitably crashes!!!\r\n\r\n\r\n```\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n[LOG] GET /subscribe?id=12345&type=xyz&email=xyz&hv=xyz\r\n[DRAKOV] GET /subscribe{?id,type,email,hv} Subscribe by email\r\n\r\n```\r\n\r\n\r\n"}}