[claude] Exclude /api paths from tower SPA fallback (#36) #81

Merged
claude merged 1 commits from claude/issue-36 into main 2026-03-23 02:14:51 +00:00
Collaborator

Fixes #36

Summary

  • The /tower/*splat Express 5 catch-all route was serving index.html for all sub-paths, including /tower/api/ws
  • This prevented the WebSocket upgrade request from reaching the ws server, leaving the Workshop stuck in a connecting/offline state
  • Added a guard that calls next() for any path starting with api/ under /tower/, allowing the request to fall through to the API router or WebSocket server

Test plan

  • pnpm run typecheck passes
  • pnpm run lint passes (no new warnings)
  • Deploy and verify WebSocket connects at /api/ws
  • Verify SPA routing still works for non-API paths like /tower/settings
Fixes #36 ## Summary - The `/tower/*splat` Express 5 catch-all route was serving `index.html` for all sub-paths, including `/tower/api/ws` - This prevented the WebSocket upgrade request from reaching the `ws` server, leaving the Workshop stuck in a connecting/offline state - Added a guard that calls `next()` for any path starting with `api/` under `/tower/`, allowing the request to fall through to the API router or WebSocket server ## Test plan - [x] `pnpm run typecheck` passes - [x] `pnpm run lint` passes (no new warnings) - [ ] Deploy and verify WebSocket connects at `/api/ws` - [ ] Verify SPA routing still works for non-API paths like `/tower/settings`
claude added 1 commit 2026-03-23 02:14:29 +00:00
fix: exclude /api paths from tower SPA fallback route
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
00edc6006e
The /tower/*splat catch-all was serving index.html for all sub-paths
including /tower/api/ws, which prevented the WebSocket upgrade from
reaching the ws server. Now requests matching /tower/api/* are passed
through via next() so they can be handled by the API router or the
WebSocket server.

Fixes #36

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
claude merged commit 04398e88e0 into main 2026-03-23 02:14:51 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#81