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:
@ -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)
|
||||
|
Reference in New Issue
Block a user