()
| 92 | |
| 93 | #[tokio::main] |
| 94 | async fn main() { |
| 95 | let cors = warp::cors() |
| 96 | .allow_any_origin() |
| 97 | .allow_header("content-type") |
| 98 | .allow_methods(&[Method::PUT, Method::DELETE, Method::GET, Method::POST]); |
| 99 | |
| 100 | let get_items = warp::get() |
| 101 | .and(warp::path("questions")) |
| 102 | .and(warp::path::end()) |
| 103 | .and_then(get_questions); |
| 104 | |
| 105 | |
| 106 | let routes = get_items.with(cors).recover(return_error); |
| 107 | |
| 108 | warp::serve(routes) |
| 109 | .run(([127, 0, 0, 1], 3030)) |
| 110 | .await; |
| 111 | } |
nothing calls this directly
no outgoing calls
no test coverage detected