-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-featureCategory: new functionalityCategory: new functionalityD-mediumDifficulty (estimate): MediumDifficulty (estimate): Medium
Description
Possible API
Files::new("/", ["./dist", "./public"])Cavets
As noted in the discussion answers, this does make it hard to support options like show_index.
Discussed in #3398
Originally posted by Aobanana-chan June 10, 2024
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:
App::new()
.service(Files::new("/", "./dist"))
.service(Files::new("/", "./public"))
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-featureCategory: new functionalityCategory: new functionalityD-mediumDifficulty (estimate): MediumDifficulty (estimate): Medium