Vue axios request url always using local server url

  axios, laravel, vue.js

I need to consume external url api.
created an instance of axios with base url

export const regionClient = axios.create({
   baseUrl: ""

using it in a function

getToken() {
   const source = axios.CancelToken.source();

   store.commit("region/ADD_REQUEST", { key: "token", cancel: source.cancel });
   return regionClient({
      url: "/api",
      //result: "http://localhost/api"
      //needed: ""

but it always using localhost server url

Source: Laravel

Leave a Reply