5 ms·
Yes... surely the point of .env file is as a shortcut to provide env vars for local development .env file shouldn't be used in production, env vars should be i
by anentropic 2y ago
Yes... surely the point of .env file is as a shortcut to provide env vars for local development
.env file shouldn't be used in production, env vars should be injected directly
- graemep 2y agoI agree that is what should happen. That is not what dotenv does though: https://www.npmjs.com/package/dotenv#-documentation https://www.npmjs.com/package/dotenv#-documentation
- anentropic 2y agoI think dotenv would be fine as long as it doesn't raise exceptions if no .env file is found, i.e. if it works just as a helper for local dev and as a no-op for production I notice the dotenv docs are recommending dotenvx now in places: https://www.npmjs.com/package/dotenv#-manage-multiple-environments https://www.npmjs.com/package/dotenv#-manage-multiple-enviro...
- graemep 2y agoI have seen many .env files in production. SOme junior devs told me it was what they had been taught to do.