diff options
author | xengineering <mail2xengineering@protonmail.com> | 2021-03-04 13:35:17 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2021-03-04 13:35:17 +0100 |
commit | baefaadd35f915834b4c6a4a097908dddceab06f (patch) | |
tree | 0e4820e739ae540af23c0df6a47ee8d38366bd9f /actix/src/main.rs | |
parent | 3189dcd0f6ce9bbd8ceb00f261f6fa9440eeb62d (diff) | |
download | web-template-baefaadd35f915834b4c6a4a097908dddceab06f.tar web-template-baefaadd35f915834b4c6a4a097908dddceab06f.tar.zst web-template-baefaadd35f915834b4c6a4a097908dddceab06f.zip |
Support Static Files with Actix
Diffstat (limited to 'actix/src/main.rs')
-rw-r--r-- | actix/src/main.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actix/src/main.rs b/actix/src/main.rs index 51060ad..6368c76 100644 --- a/actix/src/main.rs +++ b/actix/src/main.rs @@ -2,6 +2,7 @@ extern crate clap; +use actix_files as fs; use actix_web::{get, App, HttpResponse, HttpServer, Responder}; @@ -17,6 +18,7 @@ async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .service(index_handler) + .service(fs::Files::new("/static", "./static").show_files_listing()) }) .bind(format!("{}:{}", address, port))? .run() |