Skip to content

Commit 2d19121

Browse files
author
Bastian Gruber
committed
Updated
1 parent bf79dd9 commit 2d19121

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ch_03/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Reject for InvalidId {}
5252

5353
async fn get_questions() -> Result<impl warp::Reply, warp::Rejection> {
5454
let question = Question::new(
55-
QuestionId::from_str("A").expect("No id provided"),
55+
QuestionId::from_str("1").expect("No id provided"),
5656
"First Question".to_string(),
5757
"Content of question".to_string(),
5858
Some(vec!("faq".to_string())),
@@ -95,7 +95,7 @@ async fn main() {
9595
let cors = warp::cors()
9696
.allow_any_origin()
9797
.allow_header("content-type")
98-
.allow_methods(&[Method::PUT, Method::DELETE]);
98+
.allow_methods(&[Method::PUT, Method::DELETE, Method::GET, Method::POST]);
9999

100100
let get_items = warp::get()
101101
.and(warp::path("questions"))

0 commit comments

Comments
 (0)