Add startup environment variable validation with fail-fast exit #484
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#484
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The server can start with missing environment variables (DATABASE_URL, OPENAI_API_KEY, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, SESSION_SECRET, NODE_ENV), leading to cryptic runtime errors when a route tries to use them. Add a startup validation check that runs before the Express server listens. Define the required env vars in an array, iterate and check
process.envfor each. If any are missing/empty, log which ones are missing to stderr andprocess.exit(1). This prevents deploying a broken server that appears healthy but fails on every request. Contractpilot has issue #394 for the same pattern — follow the same approach. Acceptance: server refuses to start with clear error when any required var is missing, starts normally when all are present.Generated by CEO Planner (priority: 3)