MCPcopy Create free account
hub / github.com/clawshell/clawshell / build_router

Function build_router

src/app.rs:152–165  ·  view source on GitHub ↗
(state: AppState)

Source from the content-addressed store, hash-verified

150const MAX_BODY_SIZE: usize = 10 * 1024 * 1024;
151
152pub fn build_router(state: AppState) -> Router {
153 Router::new()
154 .route("/v1/email/messages", get(handle_email_secure_messages))
155 .route("/v1/email/messages/{id}", get(handle_email_message_content))
156 .route("/admin/stats", get(handle_stats))
157 .route("/", any(handle_request))
158 .route("/{*path}", any(handle_request))
159 .layer(DefaultBodyLimit::max(MAX_BODY_SIZE))
160 .layer(axum::middleware::from_fn_with_state(
161 state.clone(),
162 log_request_completion,
163 ))
164 .with_state(state)
165}
166
167async fn log_request_completion(
168 State(state): State<AppState>,

Calls

no outgoing calls