MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / main

Function main

ch_03/src/main.rs:94–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93#[tokio::main]
94async 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected