]> Untitled Git - lemmy.git/blob - server/src/routes/index.rs
Merge branch 'federation' of https://yerbamate.dev/LemmyNet/lemmy into federation
[lemmy.git] / server / src / routes / index.rs
1 use super::*;
2
3 pub fn config(cfg: &mut web::ServiceConfig) {
4   cfg
5     .route("/", web::get().to(index))
6     .route(
7       "/home/data_type/{data_type}/listing_type/{listing_type}/sort/{sort}/page/{page}",
8       web::get().to(index),
9     )
10     .route("/login", web::get().to(index))
11     .route("/create_post", web::get().to(index))
12     .route("/create_community", web::get().to(index))
13     .route("/create_private_message", web::get().to(index))
14     .route("/communities/page/{page}", web::get().to(index))
15     .route("/communities", web::get().to(index))
16     .route("/post/{id}/comment/{id2}", web::get().to(index))
17     .route("/post/{id}", web::get().to(index))
18     .route(
19       "/c/{name}/data_type/{data_type}/sort/{sort}/page/{page}",
20       web::get().to(index),
21     )
22     .route("/c/{name}", web::get().to(index))
23     .route("/community/{id}", web::get().to(index))
24     .route(
25       "/u/{username}/view/{view}/sort/{sort}/page/{page}",
26       web::get().to(index),
27     )
28     .route("/u/{username}", web::get().to(index))
29     .route("/user/{id}", web::get().to(index))
30     .route("/inbox", web::get().to(index))
31     .route("/modlog/community/{community_id}", web::get().to(index))
32     .route("/modlog", web::get().to(index))
33     .route("/setup", web::get().to(index))
34     .route("/admin", web::get().to(index))
35     .route(
36       "/search/q/{q}/type/{type}/sort/{sort}/page/{page}",
37       web::get().to(index),
38     )
39     .route("/search", web::get().to(index))
40     .route("/sponsors", web::get().to(index))
41     .route("/password_change/{token}", web::get().to(index));
42 }
43
44 async fn index() -> Result<NamedFile, Error> {
45   Ok(NamedFile::open(
46     Settings::get().front_end_dir + "/index.html",
47   )?)
48 }