From 1993fa4893b0127eaf1f61d1971f68f2c932d40b Mon Sep 17 00:00:00 2001 From: meeg_leeto Date: Fri, 29 Apr 2022 18:47:18 +0100 Subject: [PATCH] refact: split POST and GET methods --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index b60bc22..69bccfc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -483,7 +483,9 @@ async fn serve() { .and(warp::path::param()) .map(|slug: String| warp::reply()); - let routes = warp::get().and(homepage.or(shorten).or(link)); + let get_routes = warp::get().and(homepage.or(link)); + let post_routes = warp::post().and(shorten); + let routes = get_routes.or(post_routes); println!( "Now serving lonk at IP {}, port {}!",