@@ -17,7 +17,7 @@ use crate::store::Store;
17
17
type BoxError = Box < dyn std:: error:: Error + Send + Sync > ;
18
18
type HTTPResult = Result < Response < BoxBody < Bytes , BoxError > > , BoxError > ;
19
19
20
- async fn get ( _req : Request < hyper:: body:: Incoming > ) -> HTTPResult {
20
+ async fn get ( _store : Store , _req : Request < hyper:: body:: Incoming > ) -> HTTPResult {
21
21
let preview = "hai" . to_string ( ) ;
22
22
Ok ( Response :: builder ( )
23
23
. status ( StatusCode :: OK )
@@ -34,7 +34,6 @@ async fn post(mut store: Store, req: Request<hyper::body::Incoming>) -> HTTPResu
34
34
let mut writer = writer. compat_write ( ) ;
35
35
while let Some ( frame) = body. frame ( ) . await {
36
36
let data = frame?. into_data ( ) . unwrap ( ) ;
37
- eprintln ! ( "data: {:?}" , & data) ;
38
37
writer. write_all ( & data) . await ?;
39
38
}
40
39
// get the original writer back
@@ -52,7 +51,7 @@ async fn post(mut store: Store, req: Request<hyper::body::Incoming>) -> HTTPResu
52
51
async fn handle ( store : Store , req : Request < hyper:: body:: Incoming > ) -> HTTPResult {
53
52
eprintln ! ( "req: {:?}" , & req) ;
54
53
match req. method ( ) {
55
- & Method :: GET => get ( req) . await ,
54
+ & Method :: GET => get ( store , req) . await ,
56
55
& Method :: POST => post ( store, req) . await ,
57
56
_ => response_404 ( ) ,
58
57
}
0 commit comments