domani/src/service/http_tpl.rs

13 lines
299 B
Rust
Raw Normal View History

use handlebars::{Handlebars, TemplateError};
#[derive(rust_embed::RustEmbed)]
#[folder = "src/service/http_tpl"]
#[prefix = "/"]
struct Dir;
pub fn get() -> Result<Handlebars<'static>, TemplateError> {
let mut reg = Handlebars::new();
reg.register_embed_templates::<Dir>()?;
Ok(reg)
}