nuxt-community / axios-module

Secure and easy axios integration for Nuxt 2
https://axios.nuxtjs.org
MIT License
1.2k stars 245 forks source link

(help wanted) Define an empty baseUrl #553

Open arthur-fontaine opened 2 years ago

arthur-fontaine commented 2 years ago

[Reposted from my message on the Nuxt Discord server]

Hello, I have my API that is running with the serverMiddleware (/api). So to call it, I just have to use /api with Axios. It works fine in my TypeScript files because they don't use the instance created by Nuxt. But in my Vue files, which use the instance created by Nuxt, it does not work (it makes the request to http://localhost:3000/api). I suppose that I have to change the baseUrl. I tried { baseUrl: '' }, but it does not work. Is there something that I am missing?