async fn response(req: Request<Body>) -> Result<Response<Body>> {
    let path = req.uri().path();
    match (req.method(), path) {
        (&Method::GET, "/") | (&Method::GET, "/index.html") => {
            send_file(INDEX).await
        }
        (&Method::GET, path) => send_file(&path[1..]).await,
        _ => not_found(),
    }
}
/// returns a result conatins result response body if it's expected.
returns a result conatins result response body if it's expected.
returns a result conatins result response body if it ' s expected .
async fn response(req: Request<Body>) -> Result<Response<Body>> {
    let path = req.uri().path();
    match (req.method(), path) {
        (&Method::GET, "/") | (&Method::GET, "/index.html") => {
            send_file(INDEX).await
        }
        (&Method::GET, path) => send_file(&path[1..]).await,
        _ => not_found(),
    }
}
async fn response ( req : Request < Body > ) -> Result < Response < Body > > { let path = req . uri ( ) . path ( ) ; match ( req . method ( ) , path ) { ( & Method :: GET , " " ) | ( & Method :: GET , " " ) => { send_file ( INDEX ) . await } ( & Method :: GET , path ) => send_file ( & path [ 1 .. ] ) . await , _ => not_found ( ) , } }
returns a result conatins result response body if it's expected.
returns a result conatins result response body if it ' s expected .
req
Request<Body>
req
Request<Body>