By Craig
On Digital Ocean’s cool Apps platform, I’ve deployed an angular site as a static site and it is deployed after a push to my repo.
I’d like to make calls to an API and so require an API key and secret.
I’ve set environment files in the angular environment.ts files and used the App Platform / {app} / Settings / App-Level Environment Variables to override the environment so I don’t have to commit the secret to my repo.
But it hasn’t worked. The environment key has a scope of RUN_AND_BUILD_TIME
Any clues on how I can get it to override?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey there!
In App Platform static sites are served by a CDN and don’t have access to the runtime environment variables. They only have access to build time env variables unfortunately. One workaround to accomplish this is by using a configuration file and a script. An example of how to do this can be found in the answer here.
Hope it helps! Nate
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.