domani/src/service/http_tpl.rs
2023-05-16 16:20:01 +02:00

14 lines
306 B
Rust

use handlebars::Handlebars;
#[derive(rust_embed::RustEmbed)]
#[folder = "src/service/http_tpl"]
#[prefix = "/"]
struct Dir;
pub fn get<'hbs>() -> Handlebars<'hbs> {
let mut reg = Handlebars::new();
reg.register_embed_templates::<Dir>()
.expect("registered embedded templates");
reg
}