Hacker News new | past | comments | ask | show | jobs | submit login

Just set those env vars in your IDE. Let your IDE or docker-compose or whatever read an .env file if you must. But don't do it directly from your application code, indeed you're one lazy dev away from putting an .env file on prod servers.

Using dotenv-like constructions is, in my eyes, an antipattern.




Please don't configure important things in the IDE. IDE configs are notoriously fickle and checking them into the repo usually just leads to a lot of problems in my experience, plus it will mean duplicated effort every time you need to do something from the CLI.


I've seen so many .env files in production that I don't even wince anymore. I just formalize the finding by email and carry on.


And it need not even be an IDE. Whatever environment you use for development, set environment variables in that.


> Just set those env vars in your IDE.

How is that different from a dotenv, other than location of where the k/v persists?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: