코드 4-34 /questions/:questionId에 PUT 경로 추가하기
...
#[tokio::main]
async fn main() {
let get_questions = warp::get()
.and(warp::path("questions"))
.and(warp::path::end())
.and(store_filter.clone())
.and_then(get_questions);
let add_question = warp::post()
.and(warp::path("questions"))
.and(warp::path::end())
.and(store_filter.clone())
.and(warp::body::json())
.and_then(add_question);
let update_question = warp::put() ➊
.and(warp::path("questions")) ➋
.and(warp::path::param::<String>()) ➌
.and(warp::path::end()) ➍
.and(store_filter.clone()) ➎
.and(warp::body::json()) ➏
.and_then(update_question); ➐