Skip to content

Latest commit

 

History

History
 
 

env-static

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Environment Static

Environment variable availability during hooks.

Deploy

Map the NAME environment variable to different names, based on the stage.

$ up env set NAME Tobi
$ up env set -s staging NAME Loki
$ up env set -s production NAME Jane

Deploy each stage:

$ up
$ up production

View each response:

$ curl -s `up url`
# contains: Hello Loki from staging

$ curl -s `up url production`
# contains: Hello Jane from production

Notes

This example illustrates how environment variables are available at build time, so you may utilize vars mapped to the stage you are deploying to alter configuration, client-side builds, and so on. Note that UP_STAGE and NODE_ENV by default will be the target stage name (staging, production).