I am working on a small project including react frontend and Java backend with two environments.
I struggle on the idea how to work with multiple environemnts, I declare API url using axios:
export default axios.create({
baseURL: `http://api.dev.project.local/api/v1`,
});
But this works only for one environment, how to change API url after the package is built? I don't think it is a good practise to create two builds (one for dev and one for prod), because it could create mess inside artifacts manager (we use Azure Artifacs Feed).
How do you solve this problem?