mirror of
https://github.com/actix/examples
synced 2025-06-28 18:00:37 +02:00
Update tera
to 1.0 (#212)
This commit is contained in:
@ -26,7 +26,7 @@ pub async fn index(
|
||||
|
||||
let rendered = tmpl
|
||||
.render("index.html.tera", &context)
|
||||
.map_err(|e| error::ErrorInternalServerError(e.description().to_owned()))?;
|
||||
.map_err(|e| error::ErrorInternalServerError(e))?;
|
||||
|
||||
Ok(HttpResponse::Ok().body(rendered))
|
||||
}
|
||||
|
@ -4,8 +4,6 @@ extern crate diesel;
|
||||
extern crate log;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
#[macro_use]
|
||||
extern crate tera;
|
||||
|
||||
use std::{env, io};
|
||||
|
||||
@ -37,7 +35,7 @@ async fn main() -> io::Result<()> {
|
||||
let app = move || {
|
||||
debug!("Constructing the App");
|
||||
|
||||
let templates: Tera = compile_templates!("templates/**/*");
|
||||
let templates: Tera = Tera::new("/templates/**/*").unwrap();
|
||||
|
||||
let session_store = CookieSession::signed(SESSION_SIGNING_KEY).secure(false);
|
||||
|
||||
|
Reference in New Issue
Block a user