You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the best way to change api key or api domain uri based on a different stage in a single page application?
If this were a lambda, I would use environment variables in the serverless yml file, but since these are static files I'm not sure the best way to do this.
The text was updated successfully, but these errors were encountered:
When I have multiple stages (dev, prod) how do I define different values to my environment variables (e.g. REACT_APP_API_URL) for each stage, using the same serverless.yml.
The current answer is to use .env files, as per #44 .
@eahefnawy Is there no way to set env vars in the serverless.yml and point them to a param from the cloud app settings? I've done this in other apps and it would be disappointing if this isn't possible:
My use case is the redirect URIs are different from prod and dev and this needs injected into the code at build time depending on the stage. None of these are sensitive values so it's fine that they are on the client.
If this is possible, maybe I'm trying to reference them incorrectly. Right now, I just get empty strings or undefined in the React render template.
What's the best way to change api key or api domain uri based on a different stage in a single page application?
If this were a lambda, I would use environment variables in the serverless yml file, but since these are static files I'm not sure the best way to do this.
The text was updated successfully, but these errors were encountered: