Add new debug endpoint to list all registered HTTP routes with their
methods and optional names. This helps with debugging and understanding
the API surface area.
The endpoint supports both text and JSON formats:
Text format (default):
```
=== Registered HTTP Routes ===
/api/v1/ [ALL]
/apple [GET]
/health [GET]
/register/{registration_id} [GET]
/ts2021 [POST, GET]
Total routes: 14
```
JSON format:
```json
{
"routes": [
{
"path": "/health",
"methods": ["GET"]
},
{
"path": "/ts2021",
"methods": ["POST", "GET"]
}
],
"total_count": 14
}
```
Usage:
- Text: curl http://localhost:9090/debug/http-routes
- JSON: curl -H "Accept: application/json" http://localhost:9090/debug/http-routes
Changes:
- Modified debugHTTPServer() to accept router parameter
- Added collectRoutes() to walk router and collect route information
- Added debugHTTPRoutes() for text output
- Added debugHTTPRoutesJSON() for structured output
- Added HTTPRouteInfo and DebugHTTPRoutesInfo types
- Added unit tests for route listing functionality