Expand description
REST API server for pipeline management (T30) + web dashboard (T31) REST API server for pipeline management (T30)
Provides an HTTP API for submitting, monitoring, and managing scraping
pipelines. Includes a built-in web dashboard served at / (T31).
§Endpoints
| Method | Path | Description |
|---|---|---|
GET | /health | Liveness probe |
GET | /metrics | Prometheus metrics |
GET | / | Web dashboard (HTML) |
POST | /pipelines | Submit a new pipeline |
GET | /pipelines | List all pipelines |
GET | /pipelines/:id | Get pipeline status |
GET | /pipelines/:id/results | Get pipeline results |
DELETE | /pipelines/:id | Cancel / delete a pipeline |
§Authentication
All /pipelines routes require an X-Api-Key header. Set the API key via
the STYGIAN_API_KEY environment variable (defaults to "dev-key" when
the variable is not set).
§Example
use stygian_graph::application::api_server::ApiServer;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let server = ApiServer::from_env();
server.run("0.0.0.0:8080").await
}Structs§
- ApiServer
- High-level API server wrapper.
- AppState
- Shared state injected into every route handler.
- Pipeline
Run - A pipeline run record stored in the in-memory registry.
- Pipeline
Status - Slim status summary returned by
GET /pipelinesandGET /pipelines/:id - Submit
Pipeline Request - Request body for
POST /pipelines - Submit
Pipeline Response - Response from
POST /pipelines
Enums§
- Pipeline
State - Current execution state of a submitted pipeline.
Functions§
- build_
router - Build the axum [
Router] with all routes and middleware attached.