{"action":"created","issue":{"url":"https://api.github.com/repos/yahoo/fluxible-plugin-fetchr/issues/35","labels_url":"https://api.github.com/repos/yahoo/fluxible-plugin-fetchr/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/yahoo/fluxible-plugin-fetchr/issues/35/comments","events_url":"https://api.github.com/repos/yahoo/fluxible-plugin-fetchr/issues/35/events","html_url":"https://github.com/yahoo/fluxible-plugin-fetchr/issues/35","id":89460660,"number":35,"title":"Service look up returns \"404 not found\" when invoked from Client.","user":{"login":"raviksha","id":12366521,"avatar_url":"https://avatars.githubusercontent.com/u/12366521?v=3","gravatar_id":"","url":"https://api.github.com/users/raviksha","html_url":"https://github.com/raviksha","followers_url":"https://api.github.com/users/raviksha/followers","following_url":"https://api.github.com/users/raviksha/following{/other_user}","gists_url":"https://api.github.com/users/raviksha/gists{/gist_id}","starred_url":"https://api.github.com/users/raviksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raviksha/subscriptions","organizations_url":"https://api.github.com/users/raviksha/orgs","repos_url":"https://api.github.com/users/raviksha/repos","events_url":"https://api.github.com/users/raviksha/events{/privacy}","received_events_url":"https://api.github.com/users/raviksha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-19T04:14:53Z","updated_at":"2015-06-19T18:32:27Z","closed_at":null,"body":"I have an app which has a registered service which is invoked and executed as expected on the initial pay load(i.e when called from initAction() on the server.\r\n\r\nThe same service when invoked from an action via the componentDidUpdate() {this.context.executeAction(loadIndex);} thows a 404 not found.\r\n\r\nAs the requirements I have - \r\n1. Registered the service on the sever.js -\r\nvar server = express();\r\nfetchr.registerService(require(\"./service/localeService\"));\r\n\r\n2. Have set up the fetchr middleware using -\r\nserver.use(fetchr.getXhrPath(), fetchr.getMiddleware());\r\n\r\n3. The app context is created as follows  in the server.js-\r\n    var context = app.createContext({\r\n        req: req, // The fetchr plugin depends on this      \r\n    });\r\n4. On the app.js have set up the xhrPath as -\r\napp.plug(fetchrPlugin({ xhrPath: \"/api\" }));\r\n\r\n5. The 'fluxible-plugin-routr' is configured to use the config/routes.js -\r\nimport routrPlugin from 'fluxible-plugin-routr';\r\nimport routes from './configs/routes';\r\napp.plug(routrPlugin({\r\n    routes: routes\r\n}));\r\n\r\nNow when the event is fired from the component the look up url is -\r\nhttp://hostname:6060/api/localeService <NetworkError: 404 Not Found>\r\n\r\nOn tracing the issue in debugger, the controls goes upto -  fetcher-plugin.js ==> fetcherCLient.js ===> httpClient.js -\r\n\r\nfunction io(url, options) {\r\n    xhr({\r\n        url: url,   ======>>> (/api/localeService)\r\n        method: options.method =====> METHOD_GET,\r\n        timeout: options.timeout,\r\n        headers: options.headers,\r\n        {X-Requested-With =====> \"XMLHttpRequest\"\r\n         useXDR ===>  undefined}\r\n        body: options.data,\r\n        useXDR: options.cors\r\n    }\r\n\r\nWhy isnt the server able to look up the registered service at \"(/api/localeService)\" ?\r\n\r\nIt doesn't make sense to have this path needs to be defined in the config/route.js ?"},"comment":{"url":"https://api.github.com/repos/yahoo/fluxible-plugin-fetchr/issues/comments/113599276","html_url":"https://github.com/yahoo/fluxible-plugin-fetchr/issues/35#issuecomment-113599276","issue_url":"https://api.github.com/repos/yahoo/fluxible-plugin-fetchr/issues/35","id":113599276,"user":{"login":"Vijar","id":759766,"avatar_url":"https://avatars.githubusercontent.com/u/759766?v=3","gravatar_id":"","url":"https://api.github.com/users/Vijar","html_url":"https://github.com/Vijar","followers_url":"https://api.github.com/users/Vijar/followers","following_url":"https://api.github.com/users/Vijar/following{/other_user}","gists_url":"https://api.github.com/users/Vijar/gists{/gist_id}","starred_url":"https://api.github.com/users/Vijar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vijar/subscriptions","organizations_url":"https://api.github.com/users/Vijar/orgs","repos_url":"https://api.github.com/users/Vijar/repos","events_url":"https://api.github.com/users/Vijar/events{/privacy}","received_events_url":"https://api.github.com/users/Vijar/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T18:32:27Z","updated_at":"2015-06-19T18:32:27Z","body":"`http://:6060/api/productService` isn't really a valid URL. Did you remove the hostname for privacy reasons or is this the URL actually generated by fetchr?"}}