Split index page
Dependencies
- [2]
65A3LIWUUse handlebars to render index - [3]
BCXEUKX6Add config, static files and web server - [4]
OJO4B4QOAdd login form and empty handler - [*]
4MZ4VIR7Initial commit
Change contents
- file addition: pages[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
use actix_web::{middleware, web, App, HttpResponse, HttpServer};use actix_web::{middleware, web, App, HttpServer}; - replacement in src/main.rs at line 11
async fn index(hb: web::Data<Handlebars<'_>>) -> HttpResponse {let body = hb.render("index", &()).expect("render index");HttpResponse::Ok().body(body)}mod pages;use pages::index::index;