From cf4c5e1fe815b677dbc1a8c4606efcc8e95216c9 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Thu, 14 Jan 2021 10:57:50 -0800 Subject: [PATCH] Implement #53 --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d9d6a4a..87d302f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,15 @@ async fn main() -> std::io::Result<()> { // Proxy media through Libreddit .route("/proxy/{url:.*}/", web::get().to(proxy::handler)) // Browse user profile - .route("/{scope:u|user}/{username}/", web::get().to(user::profile)) + .service( + web::scope("/{scope:user|u}").service( + web::scope("/{username}").route("/", web::get().to(user::profile)).service( + web::scope("/comments/{id}/{title}") + .route("/", web::get().to(post::item)) + .route("/{comment_id}/", web::get().to(post::item)), + ), + ), + ) // Configure settings .service(web::resource("/settings/").route(web::get().to(settings::get)).route(web::post().to(settings::set))) // Subreddit services