Refactor the environment variables to have a single env variable for the API calls using the middleware
Another enhancement is to use the env-cmd package to allow multiple .env files e.g. 1 for production, 1 for staging
env-cmd
.env