Beau supports DotEnv out of the box. Any variables defined in your .env file will be available as a environmental variable within your beau.yml file.


Given this .env file:


You'd have POST available under $env._ in your beau file. You can use it like this:

GET /post/$env._.POST: get-post

Keep in mind that variables defined in your .env will override variables defined in your beau.yml file. So given this beau.yml file:

        post: 1

GET /post/$ get-post

and this .env file:


$ will resolve to "2". You can use this to have defaults in place which can be replaced locally as needed.

Remember to keep your .env file out of your repo to prevent weird, hard-to-debug bugs.

These external environment variables are also shared with the param flag when requesting something. They also have a lower priority so you can use the param flag to override these values. Checkout Request for more information.