From 170ea384fbb6490494ef85d7279da9ce44d560a4 Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Tue, 1 Nov 2022 20:53:42 -0700 Subject: [PATCH] Support /comments endpoint (closes #568) Code based on @Daniel-Valentine's [implementation](https://github.com/ferritreader/libreddit-fork/commit/e2c84879d658f28d80c318b3bcc24f12e14c807a) --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 37871b0..4ce4a96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -238,6 +238,11 @@ async fn main() { app.at("/r/:sub/comments/:id").get(|r| post::item(r).boxed()); app.at("/r/:sub/comments/:id/:title").get(|r| post::item(r).boxed()); app.at("/r/:sub/comments/:id/:title/:comment_id").get(|r| post::item(r).boxed()); + app.at("/comments/:id").get(|r| post::item(r).boxed()); + app.at("/comments/:id/comments").get(|r| post::item(r).boxed()); + app.at("/comments/:id/comments/:comment_id").get(|r| post::item(r).boxed()); + app.at("/comments/:id/:title").get(|r| post::item(r).boxed()); + app.at("/comments/:id/:title/:comment_id").get(|r| post::item(r).boxed()); app.at("/r/:sub/search").get(|r| search::find(r).boxed());