Skip to main content

router

Function router 

Source
pub fn router(state: Arc<ServerState>) -> Router
Expand description

Build the axum router with the libfw routes mounted.

Routes:

  • GET /file/{*path} — download with Range / ETag / compression
  • HEAD /file/{*path} — metadata only
  • POST /file/{*path} — streaming upload (headers: x-libfw-file-meta, optional x-libfw-offset, optional x-libfw-compress)
  • GET /dir/{*path} — directory listing (JSON)

All routes first pass through [validate_protocol], which enforces the x-libfw-protocol handshake shared with the WASM client.