From 18ba3eba3c1ea53a22e824be57ad4c32e9c2564e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 11 Apr 2018 12:19:10 +0200 Subject: fix(main): Correctly set up rendering actor --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 72bc5e00e897..434bd40f3c67 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,6 +83,12 @@ fn main() { let oidc_addr: Addr = oidc.start(); + info!("Compiling templates ..."); + let template_path = concat!(env!("CARGO_MANIFEST_DIR"), "/templates/**/*"); + let tera = compile_templates!(template_path); + let renderer = render::Renderer(tera); + let renderer_addr: Addr = renderer.start(); + info!("Initialising HTTP server ..."); let bind_host = config_default("CONVERSE_BIND_HOST", "127.0.0.1:4567"); let key = { @@ -95,12 +101,10 @@ fn main() { }; server::new(move || { - let template_path = concat!(env!("CARGO_MANIFEST_DIR"), "/templates/**/*"); - let tera = compile_templates!(template_path); let state = AppState { db: db_addr.clone(), oidc: oidc_addr.clone(), - tera, + renderer: renderer_addr.clone(), }; let sessions = SessionStorage::new( -- cgit 1.4.1