HTTP API
Start the server
Built with the serve feature, codeweb serve loads the project store and starts an HTTP server with an embedded browser UI:
| Flag | Default | Meaning |
|---|---|---|
-p, --project | . | Project directory |
-a, --addr | 127.0.0.1:3000 | Bind address (host:port) |
--open | off | Open the browser after startup |
--log-level | info | Access log level: info or debug |
The UI offers a node list with search, a Cytoscape.js graph canvas with dagre layout, and a detail panel with callers/callees. Requests are CORS-permissive and logged to .codeweb/ in the project directory.
REST endpoints
All endpoints live under /api/v1 and return JSON unless noted.
| Method | Path | Parameters | Description |
|---|---|---|---|
| GET | /api/v1/stats | — | Node counts by type, edge count, project name |
| GET | /api/v1/files | — | Analyzed files with node counts |
| GET | /api/v1/nodes | search, node_type, orphan, low_degree, limit (default 100), offset (default 0) | Filter and paginate node summaries; search sorts by match rank |
| GET | /api/v1/nodes/:id | — | Node properties, direct callers, callees |
| GET | /api/v1/nodes/:id/callers | limit, offset, depth | Upstream neighbors |
| GET | /api/v1/nodes/:id/callees | limit, offset, depth | Downstream neighbors |
| GET | /api/v1/nodes/search-sql | q (required) | Search mapper/sql nodes by SQL content, scored |
| GET | /api/v1/trace | from (required), depth (default 2, capped at 10), max_nodes (default 500) | Bidirectional call chain trees; response reports truncated |
| GET | /api/v1/columns | exactly one of procedure, package; optional table | Aggregated column analysis (issue #165 JSON) |
| GET | /api/v1/lineage | target (required), direction (upstream/downstream/both), depth (default 5) | Table/column lineage |
| POST | /api/v1/query | body: QuerySpec JSON | Declarative traversal |
| GET | /api/v1/export | format: dot, json, ndjson, mermaid | Download the graph |
| GET | /api/v1/graph | — | Full graph payload used by the browser UI canvas |
Status codes follow the convention: 404 when a name matches nothing, 400 for ambiguous names or invalid parameters (for example passing both procedure and package to /api/v1/columns).
Examples
Security boundaries
The server reads the project store and binds the address you give it. It does not authenticate requests, and CORS is fully permissive, so treat it as a local development tool: do not expose it to untrusted networks. Read paths may point anywhere under analysis.paths; the serve mode has no write endpoints.