bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.77k stars 1.32k forks source link

Problem setting environment variable API_BASE_URL #231

Closed RasmusN closed 2 years ago

RasmusN commented 2 years ago

I'm running into trouble when I try to run yarn dev against the production backend. I am running the dev server on Ubuntu using WSL2. My backend is running on port 8000 so I try to start the dev server with the following command:

API_BASE_URL=http://localhost:8000 yarn dev

However, axios sends the API-calls to http://localhost:8080 and not http://localhost:8000. I also noticed that the mocked API-server stops working when I do this, so it seems like the API_BASE_URL gets registered somewhere. I also tried putting API_BASE_URL=http://localhost:8000 in a .env file but get the same issue.

Any ideas?

RasmusN commented 2 years ago

Shame on me for not looking through previous issues more closely, this was the issue: https://github.com/bencodezen/vue-enterprise-boilerplate/issues/98#issuecomment-428231680