Skip to content

Commit 830ec61

Browse files
committed
wip
1 parent a7d0e63 commit 830ec61

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/http.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::store::Store;
1717
type BoxError = Box<dyn std::error::Error + Send + Sync>;
1818
type HTTPResult = Result<Response<BoxBody<Bytes, BoxError>>, BoxError>;
1919

20-
async fn get(_req: Request<hyper::body::Incoming>) -> HTTPResult {
20+
async fn get(_store: Store, _req: Request<hyper::body::Incoming>) -> HTTPResult {
2121
let preview = "hai".to_string();
2222
Ok(Response::builder()
2323
.status(StatusCode::OK)
@@ -34,7 +34,6 @@ async fn post(mut store: Store, req: Request<hyper::body::Incoming>) -> HTTPResu
3434
let mut writer = writer.compat_write();
3535
while let Some(frame) = body.frame().await {
3636
let data = frame?.into_data().unwrap();
37-
eprintln!("data: {:?}", &data);
3837
writer.write_all(&data).await?;
3938
}
4039
// get the original writer back
@@ -52,7 +51,7 @@ async fn post(mut store: Store, req: Request<hyper::body::Incoming>) -> HTTPResu
5251
async fn handle(store: Store, req: Request<hyper::body::Incoming>) -> HTTPResult {
5352
eprintln!("req: {:?}", &req);
5453
match req.method() {
55-
&Method::GET => get(req).await,
54+
&Method::GET => get(store, req).await,
5655
&Method::POST => post(store, req).await,
5756
_ => response_404(),
5857
}

0 commit comments

Comments
 (0)