Skip to content

Browser testserver panics on startup due to static route conflict #107

Description

@vuon9

Summary

go run ./cmd/testserver panics before serving the browser build, so the documented browser mode at http://localhost:8081 cannot be used for tool testing or browser access.

Affected tool / area

Browser/server mode, cmd/testserver.

Repro steps

  1. From repo root, build the frontend: cd frontend && npm run build.
  2. From repo root, run: go run ./cmd/testserver.
  3. Observe startup panic before port 8081 is available.

Expected

The testserver starts and serves the frontend plus generated HTTP API endpoints on http://localhost:8081.

Actual

The process panics after registering services:

panic: catch-all wildcard '*filepath' in new path '/*filepath' conflicts with existing path segment 'health' in existing prefix '/health'
...
github.com/gin-gonic/gin.(*RouterGroup).StaticFS(...)
main.main()
  /Users/vmini/workspace/devtoolbox/cmd/testserver/main.go:48

Root-cause notes

router.NewServer() already registers API/health routes, then cmd/testserver/main.go calls engine.StaticFS("/", http.Dir("frontend/dist")). Gin expands that to a root catch-all route (/*filepath), which conflicts with the existing /health prefix.

Verification

  • npm run build: passed.
  • go run ./cmd/testserver: reproduces consistently.
  • go test ./...: passed, so current automated tests do not cover this startup path.

Priority

High: this blocks browser-mode manual testing and any service-backed frontend E2E run through the HTTP API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autoAutomatically discovered or filed by bot testingbugSomething isn't workingpriority:highHigh priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions