We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7759dca commit 4ea519bCopy full SHA for 4ea519b
1 file changed
apps/backend/src/env.ts
@@ -8,9 +8,10 @@ const envPath = path.resolve(__dirname, '../../../.env');
8
const result = dotenv.config({ path: envPath });
9
10
if (result.error) {
11
- // Keep failing fast but avoid leaking via console in production code paths.
12
- // This file runs before the Fastify logger is available; throw so the process exits.
13
- throw result.error;
14
-} else {
15
- // .env loaded successfully
+ if (process.env.NODE_ENV === 'production') {
+ // In production, env vars come from Kubernetes secrets — .env file is not expected.
+ } else {
+ // In development, .env is required. Fail fast.
+ throw result.error;
16
+ }
17
}
0 commit comments