Managing multiple environments in NestJS
So, recently I started working on a new startup and each time I do, I try to adopt a new technology be it language or framework . (this is not always recommended, in this case I have previous experience with NestJS)
This time around I chose to adopt ...
petroskyriakou.hashnode.dev7 min read
Glad to see someone else had the same requirements in regards to managing environments and environment variables in NestJS. What we ended up using was nest-typed-config with its multiple loaders approach.
Basically we have 4 different config files:
We still leverage the env var loader with highest precedence to adhere to 12factor principles, while providing sane defaults to ease the setup and being developer friendly.