hono
hono copied to clipboard
Proposal: serveStatic should support extensionless file requests
What is the feature you are proposing?
For my use case, I would like to achieve the following behavior when serving static files:
GET /config → serve /static/config
Not /static/config/index.html but a file named config without extension.
Currently it seems like serveStatic always tries to find the index file in the directory.
I would like to suggest a mode that prefers exact path match.
This would be useful when using static files that intentionally have no extension (e.g. compiled WASM glue, config binaries, etc.).
Thanks!
I think this is a good suggestion. I'll work on the serve-static things later. We can add this feature then.