Vue API Base URL storage


Im looking to create a large scale Vue application which will be deployed to many customers.
In this scenario, where is the best place to store the Base URL of an API?

From what I have read, the standard method is to create a .env file but I need this configurable per site and not just at compile time


Best practice for creating multiple environments files for one service is to create a repository for the configurations and there you can host multiple environment files. But for that you’ll need to automate the process of downloading that file from your repository with bash… hope it helps.

Is there not an option to have a config file which ships with the app that can be separate and setup for each customer environment which vue will read at runtime?

We are looking to have one production build which we ship to all customers but the paths for the API will need to be different for each deployment

hi @vjh_uk1

This sounds like a multi tenant application where the base url should be coming from a database. And If it is not a shared database, you should consider a cron job or a queue that works in the backend that creates the .env file.