@@ -10,6 +10,7 @@ use axum::{
1010 response:: { IntoResponse , Response } ,
1111} ;
1212use axum:: body:: Body ;
13+ use axum_macros:: debug_handler;
1314use crate :: keyvalue:: keyvalue_proto:: key_value_server:: KeyValue ;
1415use crate :: keyvalue:: keyvalue_proto:: GetRequest ;
1516
@@ -39,39 +40,37 @@ impl HttpHandler {
3940 // let hello2 = move |req: HttpRequest<()>| {
4041 // (StatusCode::BAD_REQUEST, "Hello World").into_response()
4142 // };
42-
43- // ****************
44- // TODO - fix this
45- // - Add request: axum::http::Request<()> to the closure makes this not work?!
46- // ****************
4743 Router :: new ( ) . route (
4844 "/get" ,
4945 get ( |request : axum:: http:: Request < Body > | async move {
46+ // TODO ---- remove the semicolon and it won't compile...
5047 HttpHandler :: handle_get ( request) ;
5148 } ) ,
5249 )
5350 }
5451
55- fn make_response ( code : StatusCode , message : String ) -> axum:: http:: Response < String > {
56- Response :: builder ( )
57- . status ( code)
58- . body ( "foo" . to_string ( ) )
59- . unwrap ( )
52+ fn make_response ( code : StatusCode , message : String ) -> ( StatusCode , String ) {
53+ todo ! ( )
54+ //
55+ // Response::builder()
56+ // .status(code)
57+ // .body("foo".to_string())
58+ // .unwrap()
6059 }
6160
62- fn invalid ( message : String ) -> axum :: http :: Response < String > {
61+ fn invalid ( message : String ) -> ( StatusCode , String ) {
6362 Self :: make_response ( StatusCode :: BAD_REQUEST , message)
6463 }
6564
6665 //#[debug_handler]
6766 async fn handle_get (
6867 //kv: Arc<dyn KeyValue + Send + Sync + 'static>,
6968 request : axum:: http:: Request < Body > ,
70- ) -> axum :: http :: Response < String > {
71- let query = match request. uri ( ) . query ( ) {
72- Some ( q) => q,
73- None => return HttpHandler :: invalid ( "must pass query" . to_string ( ) ) ,
74- } ;
69+ ) -> ( ) {
70+ // let query = match request.uri().query() {
71+ // Some(q) => q,
72+ // None => return HttpHandler::invalid("must pass query".to_string()),
73+ // };
7574 todo ! ( )
7675 //
7776 // let parsed = querystring::querify(query);
0 commit comments