Split index page

O01eg
Jan 25, 2022, 2:07 PM
EVP2FSBHQUCAXQ6IIMBD6IS24ODKHP6HFWYCHIMYG6KOFRQG3RVQC

Dependencies

  • [2] 65A3LIWU Use handlebars to render index
  • [3] BCXEUKX6 Add config, static files and web server
  • [4] OJO4B4QO Add login form and empty handler
  • [*] 4MZ4VIR7 Initial commit

Change contents

  • file addition: pages (d--r------)
    [6.6]
  • file addition: mod.rs (----------)
    [0.17]
    pub mod index;
  • file addition: index.rs (----------)
    [0.17]
    use actix_web::{web, HttpResponse};
    use handlebars::Handlebars;
    pub async fn index(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
    let body = hb.render("index", &()).expect("render index");
    HttpResponse::Ok().body(body)
    }
  • replacement in src/main.rs at line 4
    [2.27][2.27:92]()
    use actix_web::{middleware, web, App, HttpResponse, HttpServer};
    [2.27]
    [3.0]
    use actix_web::{middleware, web, App, HttpServer};
  • replacement in src/main.rs at line 11
    [2.123][2.123:286]()
    async fn index(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
    let body = hb.render("index", &()).expect("render index");
    HttpResponse::Ok().body(body)
    }
    [2.123]
    [3.94]
    mod pages;
    use pages::index::index;