ProTipβ’: Use Bruno with an Existing `.env`
Published
Bruno is a breath of fresh air. Replicating the UI/UX of Postman, Insomnia, and similar but with the killer feature of it all living locally on the filesystem in a format that is easily readable to humans and software e.g. Git is absolutely a game changer. I hope to see them succeed in the niche domain. I spent the $19 USD on the Golden Edition in an effort to support that reality.
I first tried Bruno when doing an interview take-home project a couple months back. Technically, it was a create-react-app
that did a bit of API logic and rendered some widgets to the UI. These were authorized APIs i.e. I had an API key set via a .env.local
in the repository root and I wanted to use those same envars1 in Bruno, which wants a .env
file in the collection root.
So, given a filesystem structure:
project root
βββ bruno
β βββ environments
β β βββ Local.bru
β βββ Your Request.bru
β βββ .env -> ../.env.local
β βββ bruno.json
βββ .env.local
Do you see it? The βsecretβ is using a symlink. Hereβs how:
cd bruno
ln -s ../.env.local .env
cd -
Just a few lines to reduce development friction and improve the developer experience (DX). What makes this slick is symlinks are well supported and even tracked by Git.
Iβve always thought it should be βenvarβ not βenv varβ, βenv-varβ, etc.β©οΈ
I love hearing from readers so please feel free to reach out.
Reply via email • Subscribe via RSS or email
Last modified #protip #dev #documentation #dx