Skip to content

feat(api): add /api/ws canonical listener route; keep /ws as compat alias#15

Merged
revtex merged 1 commit intodevfrom
restructure/phase-1-api-ws-alias
Apr 24, 2026
Merged

feat(api): add /api/ws canonical listener route; keep /ws as compat alias#15
revtex merged 1 commit intodevfrom
restructure/phase-1-api-ws-alias

Conversation

@revtex
Copy link
Copy Markdown
Owner

@revtex revtex commented Apr 24, 2026

What

  • Register GET /api/ws (canonical) alongside GET /ws (compat alias). Both delegate to the same ws.HandleListenerWS so listener behavior is identical on either path.
  • Frontend listener client now connects to /api/ws.
  • Vite dev proxy covers both /api/ws and /ws with WebSocket upgrade.
  • Add api_test.TestListenerWSAlias asserting both routes are registered and share the same handler.
  • Deployment guide reverse-proxy section now lists /api/ws alongside /ws and /api/admin/ws as paths needing WS-upgrade forwarding.

Why

OpenScanner's canonical API is /api/*; the listener WebSocket was the one stray inherited endpoint living at /ws. This adds the canonical path without breaking existing Trunk-Recorder / SDRTrunk / rdio-scanner-shaped clients that still speak to /ws. First step toward a coherent /api/ surface.

Blast radius

No wire-protocol changes. No schema changes. No auth surface changes. Pure additive route registration + frontend URL swap.

Verification

  • go build ./... && go vet ./... && go test ./internal/api/... ./internal/ws/... — green
  • pnpm exec tsc --noEmit && pnpm test -- --run — 188/188 tests pass

Changelog

  • [Unreleased] entries added under ### Added and ### Changed.

…lias

- Register GET /api/ws (canonical) alongside GET /ws (compat alias).
  Both delegate to the same ws.HandleListenerWS so behavior is identical.
- Frontend listener client now connects to /api/ws.
- Vite dev proxy covers both /api/ws and /ws with WebSocket upgrade.
- Add api_test.TestListenerWSAlias asserting both routes are registered
  and share the same handler.
- Deployment guide reverse-proxy section now lists /api/ws alongside
  /ws and /api/admin/ws as paths needing WS-upgrade forwarding.

The /ws alias is kept for existing Trunk-Recorder / SDRTrunk / rdio-
scanner-shaped clients during the legacy-API transition.
@revtex revtex merged commit 12db9f6 into dev Apr 24, 2026
4 checks passed
@revtex revtex deleted the restructure/phase-1-api-ws-alias branch April 24, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant