1
0
mirror of https://github.com/actix/actix-website synced 2024-11-28 02:22:57 +01:00
actix-website/examples/static-files/src/configuration_two.rs
2019-12-29 03:36:24 +09:00

19 lines
396 B
Rust

// <config-two>
use actix_files as fs;
use actix_web::{App, HttpServer};
#[actix_rt::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:8088")?
.run()
.await
}
// </config-two>