domani/src/service/http/tpl.rs

14 lines
303 B
Rust
Raw Normal View History

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