1
0
mirror of https://github.com/actix/examples synced 2024-11-28 00:12:57 +01:00
examples/template_yarte/src/main.rs

20 lines
462 B
Rust
Raw Normal View History

2019-03-12 21:15:53 +01:00
use actix_web::{middleware, web, App, HttpServer};
#[path = "lib.rs"]
mod template;
fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "actix_web=info");
env_logger::init();
// start http server
HttpServer::new(|| {
App::new()
// enable logger
.middleware(middleware::Logger::default())
.service(web::resource("/").to(template::index))
})
.bind("127.0.0.1:8080")?
.run()
}