Open mklueh opened 2 years ago
I'm currently injecting the $axios instance into each API of the SDK, which is currently enough for me:
const api = new ProjectResourceApi(undefined, undefined, this.$axios);
However, it would still be nice to hear if there is a solution that allows this on a global level for all endpoints
Hi,
I'm using the typescript-axios in my Nuxt project.
My middleware should be called for every axios request, but this is not the case for the typescript-axios calls, as they are using another instance.
typescript-axios is using the global axios instance, which I believe is a singleton provided by axios and declared as a const within axios itself.
I have seen, it would be possible to create endpoints with their related factory, to pass an axios instance. But I would need to do that for every single endpoint, which is not an option. So my idea was, to overwrite the instance typescript-axios is using.
Is it somehow possible to use the Nuxt.js axios instance for all endpoints?