nuxt.js axios isn't sending request to localhost instead of the website url

Viewed 164

Axios seems to be working just fine in "asyncData", But when using it inside a components (page)... It doesn't get the baseURL right... it uses localhost although it's already on the server... I mean when I use :

const res = await this.$axios.$get('api/products');

it sends the request to "https://localhost:8000/api/products" instead of "https://myWebsite.com/api/products"

this is the second time I post this question... I really hope someone can help. thanks in advance.

0 Answers
Related