domani/src/service/http_tpl.rs

14 lines
306 B
Rust
Raw Normal View History

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