1
0
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:
Yuki Okushi
2019-12-19 03:25:56 +09:00
committed by GitHub
parent b12b006c03
commit 7b35cd32c7
5 changed files with 6 additions and 10 deletions

View File

@ -7,6 +7,6 @@ edition = "2018"
[dependencies]
env_logger = "0.6"
tera = "0.11"
tera = "1.0"
actix-web = "2.0.0-alpha.6"
actix-rt = "1.0.0"

View File

@ -1,9 +1,7 @@
#[macro_use]
extern crate tera;
use std::collections::HashMap;
use actix_web::{error, middleware, web, App, Error, HttpResponse, HttpServer};
use tera::Tera;
// store tera template in application state
async fn index(
@ -31,7 +29,7 @@ async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
let tera =
compile_templates!(concat!(env!("CARGO_MANIFEST_DIR"), "/templates/**/*"));
Tera::new(concat!(env!("CARGO_MANIFEST_DIR"), "/templates/**/*")).unwrap();
App::new()
.data(tera)