코드 2-27 main.rs에서 Warp 서버 시작하기(chapter_02/src/main.rs)
use std::io::{Error, ErrorKind};
use std::str::FromStr;
use warp::Filter;
...
#[tokio::main]
async fn main() {
let question = Question::new(
QuestionId::from_str("1").expect("No id provided"),
"First Question".to_string(),
"Content of question".to_string(),
Some(vec!("faq".to_string())),
);
println!("{:?}", question);
let hello = warp::get()
.map(|| format!("Hello, World!"));
warp::serve(hello)
.run(([127, 0, 0, 1], 3030))
.await;
}