Skip to content

fix: validate required server environment variables at startup#124

Merged
DeadIndian merged 1 commit into
DeadIndian:mainfrom
KGFCH2:fix/server-env-validation
Jun 3, 2026
Merged

fix: validate required server environment variables at startup#124
DeadIndian merged 1 commit into
DeadIndian:mainfrom
KGFCH2:fix/server-env-validation

Conversation

@KGFCH2
Copy link
Copy Markdown
Contributor

@KGFCH2 KGFCH2 commented Jun 2, 2026

Related Issue

Closes #123

Summary

Adds startup validation for required backend environment variables so the server fails fast on misconfiguration.

Changes Made

  • Added env validation to server/index.js
  • Checks MONGO_URI, JWT_SECRET, and SESSION_SECRET
  • Logs missing variables and exits startup if validation fails

Testing

  • Verified branch builds
  • Confirmed server startup fails cleanly when required env vars are removed
  • Confirmed normal startup when env vars are present

Impact

Improves deployment safety and prevents runtime misconfiguration issues.

Checklist

  • Code follows project standards
  • Tested locally
  • No unrelated changes included
  • Config validation added
  • Failure mode is clear and safe

@DeadIndian DeadIndian added good first issue Good for newcomers newbie Level 1 issue for ELUSOC 2026 ELUSOC labels Jun 3, 2026
@DeadIndian DeadIndian merged commit 2a27600 into DeadIndian:main Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ELUSOC good first issue Good for newcomers newbie Level 1 issue for ELUSOC 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Server starts without validating required environment variables

2 participants