1
0
mirror of https://github.com/actix/examples synced 2025-06-28 09:50:36 +02:00

Bump tera version to 1.8.0, print the listening port to cli (#421)

Co-authored-by: ZhiFeng Hu <huzhifeng@coldlake.cn>
This commit is contained in:
netroby
2021-04-25 20:15:27 +08:00
committed by GitHub
parent fb897db380
commit ef13969220
3 changed files with 86 additions and 34 deletions

View File

@ -6,6 +6,6 @@ edition = "2018"
[dependencies]
env_logger = "0.8"
tera = "1.0"
tera = "1.8.0"
actix-http = "2"
actix-web = "3"

View File

@ -31,6 +31,7 @@ async fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "actix_web=info");
env_logger::init();
println!("Listening on: 127.0.0.1:8080, open browser and visit have a try!");
HttpServer::new(|| {
let tera =
Tera::new(concat!(env!("CARGO_MANIFEST_DIR"), "/templates/**/*")).unwrap();