1
0
mirror of https://github.com/actix/actix-website synced 2024-12-02 19:52:23 +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>