1 use actix_files::NamedFile;
3 use lemmy_utils::settings::Settings;
5 pub fn config(cfg: &mut web::ServiceConfig) {
7 .route("/", web::get().to(index))
9 "/home/data_type/{data_type}/listing_type/{listing_type}/sort/{sort}/page/{page}",
12 .route("/login", web::get().to(index))
13 .route("/create_post", web::get().to(index))
14 .route("/create_community", web::get().to(index))
15 .route("/create_private_message", web::get().to(index))
16 .route("/communities/page/{page}", web::get().to(index))
17 .route("/communities", web::get().to(index))
18 .route("/post/{id}/comment/{id2}", web::get().to(index))
19 .route("/post/{id}", web::get().to(index))
21 "/c/{name}/data_type/{data_type}/sort/{sort}/page/{page}",
24 .route("/c/{name}", web::get().to(index))
25 .route("/community/{id}", web::get().to(index))
27 "/u/{username}/view/{view}/sort/{sort}/page/{page}",
30 .route("/u/{username}", web::get().to(index))
31 .route("/user/{id}", web::get().to(index))
32 .route("/inbox", web::get().to(index))
33 .route("/modlog/community/{community_id}", web::get().to(index))
34 .route("/modlog", web::get().to(index))
35 .route("/setup", web::get().to(index))
36 .route("/admin", web::get().to(index))
38 "/search/q/{q}/type/{type}/sort/{sort}/page/{page}",
41 .route("/search", web::get().to(index))
42 .route("/sponsors", web::get().to(index))
43 .route("/password_change/{token}", web::get().to(index))
44 .route("/instances", web::get().to(index));
47 async fn index() -> Result<NamedFile, Error> {
49 Settings::get().front_end_dir + "/index.html",