65A3LIWUS7UNMIHACC7ED6SSSSGQMKW4SAHQLXMT2YT6PFJ7KVUQC
OJO4B4QO2JQLMZTGTJJIXEUNDIN45RFLEJBUZBYA7IS34XDPUAVAC
4MZ4VIR7FU3PQ3WKJI6TJIKYOIIBODFEPKLMQ32S4AKPZSDFO6AQC
BCXEUKX6RVE4UQE46ITSQY2NXYK3MJT7HHL7CJOM7T4OOOCADMIAC
use actix_web::{middleware, web, App, HttpResponse, HttpServer};
use actix_web::{middleware, web, App, HttpServer};
use handlebars::Handlebars;
async fn index(hb: web::Data<Handlebars<'_>>) -> HttpResponse { let body = hb.render("index", &()).expect("render index"); HttpResponse::Ok().body(body)}
async fn index(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
let body = hb.render("index", &()).expect("render index");
HttpResponse::Ok().body(body)
}
let mut handlebars = Handlebars::new(); handlebars.set_strict_mode(true); handlebars .register_template_string("index", include_str!("templates/index.html")) .expect("index template"); let handlebars_ref = web::Data::new(handlebars);
let mut handlebars = Handlebars::new();
handlebars.set_strict_mode(true);
handlebars
.register_template_string("index", include_str!("templates/index.html"))
.expect("index template");
let handlebars_ref = web::Data::new(handlebars);
.app_data(handlebars_ref.clone()) .route("/", web::get().to(index)) .route("/index.html", web::get().to(index))
.app_data(handlebars_ref.clone())
.route("/", web::get().to(index))
.route("/index.html", web::get().to(index))