about summary refs log tree commit diff
path: root/src/main.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-11T10·19+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-11T10·19+0200
commit18ba3eba3c1ea53a22e824be57ad4c32e9c2564e (patch)
treef14ee00b72d720b0ed4c1fe4c64484422b95d58a /src/main.rs
parent1cce37446b3dbc558ffe82b1b1728279dec92175 (diff)
fix(main): Correctly set up rendering actor
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 7 insertions, 3 deletions
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<Syn, oidc::OidcExecutor> = 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<Syn, render::Renderer> = 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(