This commit is contained in:
spikecodes 2021-01-14 10:57:50 -08:00
parent 7ef4a20aff
commit cf4c5e1fe8
1 changed files with 9 additions and 1 deletions

View File

@ -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