Multiple .env for multiple countries

I don’t handle multiple countries for my own app but my app on companies do. Having these .env files: .env.production.sg .env.production.uk @Module({ imports: [ ConfigModule.forRoot({ isGlobal: true, envFilePath: `.env.${process.env.RAILWAY_ENV}.${process.env.RAILWAY_COUNTRY}`, }), ], }) export class AppModule { constructor() { console.log(`RAILWAY_ENV: ${process.env.RAILWAY_ENV}`); console.log(`RAILWAY_COUNTRY: ${process.env.RAILWAY_COUNTRY}`); } } Above just for non-sensitive data (which can be expose) tho… This post is imported from: https://thebrownbox.hashnode.dev/multiple-env-for-multiple-countries

August 6, 2025 · 1 min

Manual load .env file in NestJS

As I mentioned before that we can just use ConfigModule with .env file. But sometimes we need to access .env variables at the beginning of time, when the module is not fully loaded yet. Then we manually load it in the top of the main.ts file. import * as dotenv from 'dotenv'; dotenv.config(); This post is imported from: https://thebrownbox.hashnode.dev/manual-load-env-file-in-nestjs

August 5, 2025 · 1 min

.env with vite

In vite project I use only 2 files: .env.development .env.production The env auto match with your build process without extra manual modification. This post is imported from: https://thebrownbox.hashnode.dev/env-with-vite

August 2, 2025 · 1 min

.env files in Quasar (VueJS)

Managing environment variables in quasar quite simple. My use case only have 2 environments: local & production. So I have only 2 files: .env.dev : for local .env.prod: for production No need naming conventions when work with quasar: And access through process.env.name_of_var as normal This post is imported from: https://thebrownbox.hashnode.dev/env-files-in-quasar-vuejs

July 19, 2025 · 1 min