hono
hono copied to clipboard
feat: expose built-in MIME types
This allows users reuse builtin MIME types while adding some custom.
import { baseMimes, getMimeType } from 'hono/utils/mime';
const mimes = {
...baseMimes,
'my-own-ext': 'text/plain',
};
getMimeType('base.my-own-ext', mimes)
Author should do the followings, if applicable
- [ ] Add tests
- [ ] Run tests
- [x]
yarn denoifyto generate files for Deno
I recognize that it can be accessed indirectly by calling getMimeType twice, and it's way more performant than copying all values per each request.
However, copying once in advance is obviously 2x better than calling twice.
Hi @cometkim !
Sorry to be late.
This sounds good. I've left a comment. Check it!
If this PR is OK, I'll merge this into the "next" branch for the next minor release.
@cometkim
Thanks! Merging now.