hono icon indicating copy to clipboard operation
hono copied to clipboard

Proposal: serveStatic should support extensionless file requests

Open kentasaito opened this issue 8 months ago • 1 comments

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!

kentasaito avatar Apr 23 '25 03:04 kentasaito

I think this is a good suggestion. I'll work on the serve-static things later. We can add this feature then.

yusukebe avatar Apr 25 '25 08:04 yusukebe