Is there a simple way to set multiple folders as static directories? #3398
Replies: 1 comment 1 reply
-
Finally, I decided to fork the repository and modify the implementation of actix_files. Now it can accept a form like |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For some reasons, I am migrating my website from Node.js/Fastify to Actix Web, but I am having some difficulties setting up static directories. I tried to mount two directories, "./public" and "./dist" to "/", but it failed.
Here is a simplified example code:
In the first service, if the file is not found, it directly responds with a 404 instead of moving to the next service. I realize this approach doesn't work.
After roughly reading the actix_files code, I think I might be able to modify serve_from to be a Vec and change the relevant code to meet my needs. However, this would require copying the entire source code of actix_files, which might not be ideal. Therefore, I would like to know if there is a simpler way to achieve this functionality.
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions