use warp::http; use warp::Filter; pub fn config() -> impl Filter + Clone { // Set base path let base = warp::path("sync").and(warp::path::end()); // Set save method let save = base.and(warp::get()).and_then(save); // Set load method let load = base.and(warp::post()).and_then(load); // Specify route save.or(load) } pub async fn load() -> Result { Ok(warp::reply::with_status("Load", http::StatusCode::OK)) } pub async fn save() -> Result { Ok(warp::reply::with_status("Save", http::StatusCode::OK)) }