2019-06-17 23:35:47 +02:00
|
|
|
// <config-two>
|
2019-06-26 10:27:25 +02:00
|
|
|
use actix_files as fs;
|
|
|
|
use actix_web::{App, HttpServer};
|
2019-06-17 23:35:47 +02:00
|
|
|
|
2019-12-28 19:36:24 +01:00
|
|
|
#[actix_rt::main]
|
|
|
|
async fn main() -> std::io::Result<()> {
|
2019-06-26 10:27:25 +02:00
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new().service(
|
|
|
|
fs::Files::new("/static", ".")
|
|
|
|
.show_files_listing()
|
|
|
|
.use_last_modified(true),
|
|
|
|
)
|
|
|
|
})
|
2019-12-28 19:36:24 +01:00
|
|
|
.bind("127.0.0.1:8088")?
|
2019-06-26 10:27:25 +02:00
|
|
|
.run()
|
2019-12-28 19:36:24 +01:00
|
|
|
.await
|
2019-06-26 10:27:25 +02:00
|
|
|
}
|
2019-06-17 23:35:47 +02:00
|
|
|
// </config-two>
|