iron / iron/staticfile

Static with fallback

Open
#78 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
66
Forks
57
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have several web apps where I have a chain where I first try to serve a static file, and if it doesn't exist, fallback to another handler. What's the recommended way to use such a fallback mechanism with staticfile? Right now, i defined my own custom handler that implements this cascading by delegating to static and catching 404, but I was wondering whether this is something that can be done without a custom handler; is this something that 'static' could implement? (i.e. a constructor that takes a path and a handler to call when the file isn't on the filesystem?

thanks,
Remko

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.