mirror of
https://github.com/actix/examples
synced 2025-06-28 09:50:36 +02:00
Update tera
to 1.0 (#212)
This commit is contained in:
@ -17,7 +17,7 @@ log = "0.4.3"
|
||||
serde = "1.0.69"
|
||||
serde_derive = "1.0.69"
|
||||
serde_json = "1.0.22"
|
||||
tera = "0.11.8"
|
||||
tera = "1.0"
|
||||
|
||||
[dependencies.diesel]
|
||||
features = ["postgres", "r2d2"]
|
||||
|
@ -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