0
I have a site in vueJS that I publish in every client of mine. this site consumes endpoints. For client A I have www.clienteA.com.br/endpoint/api For client B I have www.clienteB.com.br/endpoint/api What I did didn’t work out:
- JSON file
I created a JSON file in the Static directory that has { endpoint: ""}
HTTP service in my serviceshttp I read this json to get the correct url.
Build site give a build on the site The build is via du Vue-cli
Changing Json after published take the Static folder and change the url for each client initially in the same hand.
Error
By what I see I give a build it takes the values of this JSON and injects in my code so do not postpone after the build I change the value.
Is there any way I can do this?
Is it just the URL that changes? I would do using environment variables, you would have a .env.clientea a .env.clienteb with the respective urls of each client, take a look at https://cli.vuejs.org/guide/mode-and-env.html#modes
– rnd_rss
but I would have to compile every single change. The idea was to leave it in a json and I would take the post and just swap the json content. all I realized when I do this is that the json is being compiled together and I didn’t want to, my idea was to read the json while using the site
– Marquinhos Oliveira