Jets loads environment variables from
.env files. The naming convention for these files is
Let’s say you have a Jets project that has the following dotenv files:
.env .env.development .env.test .env.production
.env file will always get loaded.
Environment Specific Variables
.env files will be loaded based on value of the
JETS_ENV environment variable in the machine you’re deploying from. So:
JETS_ENV=development jets deploywill use
JETS_ENV=test jets deploywill use
JETS_ENV=production jets deploywill use
You can set
JETS_ENV to any value, depending on whatever you want to name your environment.
Remote Only Variables
If you add “.remote” to the end of the filename, Jets will only load the values to the deployed Lambda environment. This can be useful if you need a local and remote version of the same environment. For example, you may want both a local and remote dev environment, and have the remote version use AWS RDS.
To use the remote version within the
jets console, you can use the
JETS_ENV_REMOTE=1 env variable. Example:
JETS_ENV=development JETS_ENV_REMOTE=1 jets console
Pro tip: Use the <- and -> arrow keys to move back and forward.