1
0
mirror of https://github.com/actix/actix-website synced 2024-11-25 09:12:42 +01:00
actix-website/examples/static-files/src/configuration_two.rs
2020-09-12 16:21:54 +01:00

19 lines
397 B
Rust

// <config-two>
use actix_files as fs;
use actix_web::{App, HttpServer};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new().service(
fs::Files::new("/static", ".")
.show_files_listing()
.use_last_modified(true),
)
})
.bind("127.0.0.1:8080")?
.run()
.await
}
// </config-two>