1 use crate::settings::Settings;
2 use actix_files::NamedFile;
5 pub fn config(cfg: &mut web::ServiceConfig) {
7 .route("/", web::get().to(index))
9 "/home/type/{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("/communities/page/{page}", web::get().to(index))
16 .route("/communities", web::get().to(index))
17 .route("/post/{id}/comment/{id2}", web::get().to(index))
18 .route("/post/{id}", web::get().to(index))
19 .route("/c/{name}/sort/{sort}/page/{page}", web::get().to(index))
20 .route("/c/{name}", web::get().to(index))
21 .route("/community/{id}", web::get().to(index))
23 "/u/{username}/view/{view}/sort/{sort}/page/{page}",
26 .route("/u/{username}", web::get().to(index))
27 .route("/user/{id}", web::get().to(index))
28 .route("/inbox", web::get().to(index))
29 .route("/modlog/community/{community_id}", web::get().to(index))
30 .route("/modlog", web::get().to(index))
31 .route("/setup", web::get().to(index))
33 "/search/q/{q}/type/{type}/sort/{sort}/page/{page}",
36 .route("/search", web::get().to(index))
37 .route("/sponsors", web::get().to(index))
38 .route("/password_change/{token}", web::get().to(index));
41 fn index() -> Result<NamedFile, actix_web::error::Error> {
43 Settings::get().front_end_dir.to_owned() + "/index.html",