Closed vesper8 closed 6 years ago
Hello @vesper8 !
The baseURL gets normalized, see https://github.com/christianmalek/vuex-rest-api/blob/v2/src/Resource.ts#L110.
There could be a bug. The problem could be that - if axios.defaults.baseURL
is set AND baseURL
in the Vapi constructor - that both baseURLs will be concatenated.
I've fixed it. See https://github.com/christianmalek/vuex-rest-api/blob/v2/CHANGELOG.md#270-10042018 for more info.
awesome thanks for the quick fix!!
As a result of wanting to use @websanova/vue-auth, I set a global axios root like this:
This results in my auth calls being made to /api/auth/login
This seems to be conflicting with my vapi resources however.
Previously I was setting the baseUrl to '/api' in each of my vapi resources
But this was resulting in calls being made to /api/api/posts
I tried setting baseUrl to '' as well as commenting it altogether and both of these seem to have no effect.. calls are still being made to /api/api/posts instead of /api/posts
Oddly enough however, if I change baseUrl to '/test' then it starts to make calls to /api/test/posts
So it seems like it's not possible to have a blank value as it just defaults to '/api'
Bit puzzled on how to proceed.. your thoughts would be appreciated! Thanks!