{"action":"created","issue":{"url":"https://api.github.com/repos/ipkn/crow/issues/264","repository_url":"https://api.github.com/repos/ipkn/crow","labels_url":"https://api.github.com/repos/ipkn/crow/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/ipkn/crow/issues/264/comments","events_url":"https://api.github.com/repos/ipkn/crow/issues/264/events","html_url":"https://github.com/ipkn/crow/issues/264","id":275450000,"number":264,"title":"kept receiving a 404 while trying to access a basic crow server from a js fetch request","user":{"login":"percyteng","id":10775435,"avatar_url":"https://avatars2.githubusercontent.com/u/10775435?v=4","gravatar_id":"","url":"https://api.github.com/users/percyteng","html_url":"https://github.com/percyteng","followers_url":"https://api.github.com/users/percyteng/followers","following_url":"https://api.github.com/users/percyteng/following{/other_user}","gists_url":"https://api.github.com/users/percyteng/gists{/gist_id}","starred_url":"https://api.github.com/users/percyteng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percyteng/subscriptions","organizations_url":"https://api.github.com/users/percyteng/orgs","repos_url":"https://api.github.com/users/percyteng/repos","events_url":"https://api.github.com/users/percyteng/events{/privacy}","received_events_url":"https://api.github.com/users/percyteng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-11-20T18:14:05Z","updated_at":"2017-11-20T19:42:27Z","closed_at":null,"author_association":"NONE","body":"Here is my basic crow server\r\n\r\ncrow::SimpleApp app;\r\n\r\n    CROW_ROUTE(app, \"/\")\r\n    .methods(\"GET\"_method)\r\n\t([](){\r\n    \t\tcrow::json::wvalue x;\r\n    \t    x[\"message\"] = \"Hello, World!\";\r\n    \t    return x;\r\n    });\r\n    CROW_ROUTE(app, \"/api\")([](){\r\n\t\tcrow::json::wvalue x;\r\n\t\tx[\"message\"] = \"Hello, World!\";\r\n\t\treturn x;\r\n\t});\r\n\r\n    app.port(4500).multithreaded().run();\r\n\r\nI was trying to send a standard fetch request from Javascript, however, I kept receiving a 404 request from it.\r\nWhen I tried to access the crow server on both browser and postman, they work! \r\nSo I am not sure if there is something wrong with my js fetch or just crow itself. Here is my fetch\r\n\r\nreturn fetch('http://localhost:4500', {\r\n        method: 'GET',\r\n        headers: {\r\n          'Accept': 'application/json',\r\n          'Content-Type': 'application/json',\r\n        }\r\n      })\r\n      .then((response) => {\r\n        console.log(response)\r\n        if (response.status != 200){\r\n          console.log('errors')\r\n          return\r\n        }\r\n        else{\r\n          return response.json()\r\n        }\r\n      })\r\n      .then((responseJson)=>{\r\n        console.log(responseJson)\r\n      })\r\n      .catch((error) => {\r\n        console.error(error);\r\n      });"},"comment":{"url":"https://api.github.com/repos/ipkn/crow/issues/comments/345807058","html_url":"https://github.com/ipkn/crow/issues/264#issuecomment-345807058","issue_url":"https://api.github.com/repos/ipkn/crow/issues/264","id":345807058,"user":{"login":"pierobot","id":9681769,"avatar_url":"https://avatars1.githubusercontent.com/u/9681769?v=4","gravatar_id":"","url":"https://api.github.com/users/pierobot","html_url":"https://github.com/pierobot","followers_url":"https://api.github.com/users/pierobot/followers","following_url":"https://api.github.com/users/pierobot/following{/other_user}","gists_url":"https://api.github.com/users/pierobot/gists{/gist_id}","starred_url":"https://api.github.com/users/pierobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierobot/subscriptions","organizations_url":"https://api.github.com/users/pierobot/orgs","repos_url":"https://api.github.com/users/pierobot/repos","events_url":"https://api.github.com/users/pierobot/events{/privacy}","received_events_url":"https://api.github.com/users/pierobot/received_events","type":"User","site_admin":false},"created_at":"2017-11-20T19:42:27Z","updated_at":"2017-11-20T19:42:27Z","author_association":"CONTRIBUTOR","body":"Yes that seems to be the case.\r\nThe docs say that an OPTIONS request will be sent BEFORE the other method."}}
{"actor":{"display_login":"pierobot"}}