Fix short post IDs
This commit is contained in:
parent
0bf5576427
commit
842d97e9fa
@ -59,8 +59,6 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.route("/proxy/{url:.*}/", web::get().to(proxy::handler))
|
.route("/proxy/{url:.*}/", web::get().to(proxy::handler))
|
||||||
// Browse user profile
|
// Browse user profile
|
||||||
.route("/{scope:u|user}/{username}/", web::get().to(user::profile))
|
.route("/{scope:u|user}/{username}/", web::get().to(user::profile))
|
||||||
// Short link for post
|
|
||||||
.route("/{id:.{5,6}}/", web::get().to(post::item))
|
|
||||||
// Configure settings
|
// Configure settings
|
||||||
.service(web::resource("/settings/").route(web::get().to(settings::get)).route(web::post().to(settings::set)))
|
.service(web::resource("/settings/").route(web::get().to(settings::get)).route(web::post().to(settings::set)))
|
||||||
// Subreddit services
|
// Subreddit services
|
||||||
@ -99,6 +97,8 @@ async fn main() -> std::io::Result<()> {
|
|||||||
// Search all of Reddit
|
// Search all of Reddit
|
||||||
.route("/search/", web::get().to(search::find)),
|
.route("/search/", web::get().to(search::find)),
|
||||||
)
|
)
|
||||||
|
// Short link for post
|
||||||
|
.route("/{id:.{5,6}}/", web::get().to(post::item))
|
||||||
})
|
})
|
||||||
.bind(&address)
|
.bind(&address)
|
||||||
.unwrap_or_else(|e| panic!("Cannot bind to the address {}: {}", address, e))
|
.unwrap_or_else(|e| panic!("Cannot bind to the address {}: {}", address, e))
|
||||||
|
Loading…
Reference in New Issue
Block a user