Passing default options doesn't work
henri-hulski opened this issue · comments
Henri Hulski commented
I'm using the example from README.md:
controller.addModules({
// Can pass any default options which
// will be used on all requests
http: Http({
baseUrl: '/api'
})
})
But when I have an action like
function getTodos({services, output}) {
services.http.get('todos')
.then(output.success)
.catch(output.error);
}
getTodos.async = true;
export default getTodos;
the base URL doesn't apply and I get the error
GET http://localhost:5000/todos 404 (Not Found)
Using services.http.get('/api/todos')
does work.
Christian Alfoni commented
Hi there!
Sorry about this, baseUrl is actually not implemented. I have a tendency to write docs first, to point out how I want it to work :) But forgot to implement this. Let me remove from README for now. Feel free to implement it if you want to
Florian Verdet commented
Christian Alfoni commented
Ah, great, thanks for that input @fvgoto !