From baefaadd35f915834b4c6a4a097908dddceab06f Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 4 Mar 2021 13:35:17 +0100 Subject: Support Static Files with Actix --- actix/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actix/src/main.rs') 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() -- cgit v1.2.3-70-g09d2