Skip to content

Conversation

jthomerson
Copy link
Member

The documentation said it was supposed to do mime type lookup for you
(e.g. type('.html') => 'text/html'), but that was unimplemented.

@jthomerson jthomerson requested a review from yokuze February 13, 2019 03:14
@@ -0,0 +1,25 @@
NOTE: The mime database in this folder (`standard.json`) was taken from
https://github.com/broofa/node-mime#readme, which is licensed with the following license.
The code written to read this file was written by us.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewer: I did this to reduce the package size. The mime package, even though it doesn't have any dependencies, is fairly large because of the additional more full-featured database that it includes. Since it's those additional (rarely-used) types are unlikely to be needed, and we're trying to keep our @silvermine/lambda-express package size small, I just imported the "lite" database and wrote my own wrapper for it. The MIT licensing made this acceptable to do.

The documentation said it was supposed to do mime type lookup for you
(e.g. `type('.html') => 'text/html'`), but that was unimplemented.

Rather than add a dependency on the `mime` package, we have pulled in
the "lite" database used by that package. We did this to reduce the
package size. The `mime` package, even though it doesn't have any
dependencies, is fairly large because of the additional more
full-featured database that it includes.  Since it's those additional
(rarely-used) types are unlikely to be needed, and we're trying to keep
our `@silvermine/lambda-express` package size small, we just imported
the "lite" database and wrote our own wrapper for it. The MIT licensing
made this acceptable to do.
Copy link
Contributor

@yokuze yokuze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jthomerson jthomerson merged commit 2d26590 into master Feb 13, 2019
@jthomerson jthomerson deleted the response-mime-types branch February 13, 2019 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants