Skip to content
Discussion options

You must be logged in to vote

I would recommend you to copy the parts of tower-http's ServeDir that make sense for your use case. It sounds like you wouldn't otherwise need to write files to disk, so it seems weird to do that only to be able to use ServeDir.

Though if you do want to write temporary files to disk, I can recommend the atomic-write-file crate as a way to achieve that, it pulls some neat and useful tricks beyond what you'd find in a home-grown write-with-temporary-name-then-rename implementation.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yatesco
Comment options

Answer selected by jplatte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants