1pub mod api;
4pub mod dashboard;
5pub mod openai;
6pub mod streaming;
7
8use axum::Router;
9use cortiq_engine::{CortiqRuntime, Pipeline};
10use std::sync::Arc;
11use tokio::sync::Mutex;
12use tower_http::cors::CorsLayer;
13
14pub struct AppState {
17 pub runtime: CortiqRuntime,
18 pub pipeline: Mutex<Pipeline>,
19}
20
21pub fn build_router(state: Arc<AppState>) -> Router {
23 Router::new()
24 .merge(openai::routes())
25 .merge(api::routes())
26 .merge(dashboard::routes())
27 .layer(CorsLayer::permissive())
28 .with_state(state)
29}