Avril 4 years ago
parent f25677f243
commit 20656ce80e
Signed by: flanchan
GPG Key ID: 966FE03CC0E0B199

@ -9,6 +9,7 @@ use warp::{
Filter,
Buf,
reply::Response,
http,
};
use hyper::Body;
use std::{
@ -133,7 +134,12 @@ async fn main() {
.map(|x| format!("{} bytes fed", x))
.map_err(warp::reject::custom)
}
});
})
.map(|x| http::Response::builder()
.status(201)
.body(x)
.unwrap())
.with(warp::log("markov::put"));
let read = warp::get()
.and(chain.clone())
@ -149,7 +155,8 @@ async fn main() {
Ok::<_, std::convert::Infallible>(x)
}))))
}
});
})
.with(warp::log("markov::read"));
let (addr, server) = warp::serve(push
.or(read))

Loading…
Cancel
Save