Files
AstralRinth/src/routes/index.rs
2020-05-27 20:51:28 +02:00

13 lines
293 B
Rust

use actix_web::{get, web, HttpResponse};
use handlebars::*;
#[get("/")]
pub async fn index_get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
let data = json!({
"name": "Handlebars"
});
let body = hb.render("index", &data).unwrap();
HttpResponse::Ok().body(body)
}