1
0
mirror of https://github.com/actix/actix-website synced 2025-02-13 00:25:35 +01:00

15 lines
314 B
Rust
Raw Normal View History

2019-06-17 17:35:47 -04:00
// <directory>
use actix_files as fs;
2019-06-26 04:27:25 -04:00
use actix_web::{App, HttpServer};
2019-06-17 17:35:47 -04:00
2020-09-12 16:21:54 +01:00
#[actix_web::main]
2019-12-29 03:36:24 +09:00
async fn main() -> std::io::Result<()> {
2019-06-26 04:27:25 -04:00
HttpServer::new(|| {
App::new().service(fs::Files::new("/static", ".").show_files_listing())
})
2020-09-12 16:21:54 +01:00
.bind("127.0.0.1:8080")?
2019-06-26 04:27:25 -04:00
.run()
2019-12-29 03:36:24 +09:00
.await
2019-06-17 17:35:47 -04:00
}
// </directory>