In my project, I use axios for API. And I hardcoded these API links in my code. So I want to remove hardcoding and set env variables. But I want such a setting that automatically considers the current environment that we are in prod env or dev env and sets API URL as per the current environment.
axios.get("https://jsonplaceholder.typicode.com/posts").then(response => {
this.setState({ fetchData: response.data });
});
above API URL I use only to ask the question.