Basic subscribe functionality.

This commit is contained in:
Matthew Crossman 2021-01-30 18:00:00 +11:00
parent 75bbcefbec
commit 345308a9ac
No known key found for this signature in database
GPG key ID: C6B942B019794CC2
5 changed files with 53 additions and 11 deletions

View file

@ -99,6 +99,9 @@ async fn main() -> std::io::Result<()> {
// See posts and info about subreddit
.route("/", web::get().to(subreddit::page))
.route("/{sort:hot|new|top|rising|controversial}/", web::get().to(subreddit::page))
// Handle subscribe/unsubscribe
.route("/subscribe/", web::post().to(subreddit::subscribe))
//.route("/unsubscribe/", web::post().to(subreddit::unsubscribe))
// View post on subreddit
.service(
web::scope("/comments/{id}/{title}")