1
0
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:
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

@ -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)