nuxt-community / axios-module

Secure and easy axios integration for Nuxt 2

Home Page:https://axios.nuxtjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(help wanted) Define an empty baseUrl

arthur-fontaine opened this issue · comments

[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?