fd-vue-webapp icon indicating copy to clipboard operation
fd-vue-webapp copied to clipboard

Make a better URL endpoint configuration through environment variables

Open ubaldop opened this issue 5 years ago • 0 comments

Currently, in order to configure a proper URL endpoint for API requests, there is a strange workaround here:

if (window.location.host === 'fd-vue-webapp.herokuapp.com') {
  FD_API_URL = 'http://174.138.4.3:9111/v3'
} else {
  FD_API_URL = 'http://' + window.location.hostname + ':9111/v3'
}

I think this FD_API_URL instantiation should be performed through an environment configuration, not within the fd-axios.js file itself. I mean like these.

Then, in the Heroku environment the npm run start command shall be invoked setting the proper NODE_ENV (e.g.: test).

ubaldop avatar Oct 25 '18 06:10 ubaldop