코드 4-13 /questions 경로와 경로 핸들러에 저장소 추가하기
...
#[tokio::main]
async fn main() {
let store = Store::new();
let store_filter = warp::any().map(move || store.clone());
...
let get_questions = warp::get()
.and(warp::path("questions"))
.and(warp::path::end())
.and(store_filter)
.and_then(get_questions)
.recover(return_error);
let routes = get_questions.with(cors);
warp::serve(routes).run(([127, 0, 0, 1], 3030)).await;
}
...