MCPcopy Create free account
hub / github.com/actix/examples / index

Function index

templating/handlebars/src/main.rs:16–23  ·  view source on GitHub ↗
(hb: web::Data<Handlebars<'_>>)

Source from the content-addressed store, hash-verified

14
15#[get("/")]
16async fn index(hb: web::Data<Handlebars<'_>>) -> impl Responder {
17 let data = json!({
18 "name": "Handlebars"
19 });
20 let body = hb.render("index", &data).unwrap();
21
22 web::Html::new(body)
23}
24
25#[get("/{user}/{data}")]
26async fn user(hb: web::Data<Handlebars<'_>>, path: web::Path<(String, String)>) -> impl Responder {

Callers

nothing calls this directly

Calls 1

renderMethod · 0.80

Tested by

no test coverage detected