Refactor proxy and environment handling #3

Merged
probablycorey merged 1 commits from probablycorey/refactor-proxy-fetch into main 2026-03-11 17:39:10 +00:00

Summary

  • Separate health check logic from proxy: moved /ok endpoint to server.ts, extracted dedicated healthCheck function
  • Fix WebSocket message race condition by buffering messages until upstream connects, add 5s connection timeout
  • Create env.ts for centralized environment variable handling and validation
  • Reorganize code structure: move exports to top of files, internal helpers below
  • Simplify spawn() by having it read environment directly from env.ts instead of taking parameters

🤖 Generated with Claude Code

## Summary - Separate health check logic from proxy: moved /ok endpoint to server.ts, extracted dedicated healthCheck function - Fix WebSocket message race condition by buffering messages until upstream connects, add 5s connection timeout - Create env.ts for centralized environment variable handling and validation - Reorganize code structure: move exports to top of files, internal helpers below - Simplify spawn() by having it read environment directly from env.ts instead of taking parameters 🤖 Generated with Claude Code
probablycorey added 1 commit 2026-03-11 17:38:32 +00:00
- Separate /ok health check from proxy logic into dedicated healthCheck function
- Fix WebSocket message race condition by buffering messages until upstream connects
- Add 5s timeout for WebSocket upstream connection
- Create env.ts for centralized env var handling and validation
- Move exports to top of files for better discoverability
- Remove spawn() parameter and have it read from env.ts
- Remove unused validation logic (now handled by env.ts)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
probablycorey merged commit b77a567680 into main 2026-03-11 17:39:10 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: probablycorey/tronbyt#3
No description provided.