[Vuejs]-Problems accessing Laravel api from Vue(Nuxt js) app in docker

0๐Ÿ‘

โœ…

I ended up doing this:

nuxt.config.js

env: {
    'API_URL': 'http://docker.for.win.localhost:8080/'
},

But had to change it to this after latest docker update:

'API_URL': 'http://host.docker.internal:8080/'

0๐Ÿ‘

You can set the baseURL for an Axios module in the Nuxt configuration file> nuxt.config.js.

axios: {
   baseUrl: process.env.API_URL,
   credentials: true
},

Leave a comment