cloudhead / node-static

rfc 2616 compliant HTTP static-file server module, with built-in caching.
MIT License
2.17k stars 245 forks source link

Fixed mime.lookup errors #225

Closed sarthikg closed 3 years ago

sarthikg commented 3 years ago

Replaced mime dependency with mime-types which imitates the mime@1.x and removes all the errors for mime.lookup() function.

Some discussions around this can be found here: https://stackoverflow.com/questions/46420905/webrtc-error-with-mime-lookup https://stackoverflow.com/questions/47825700/mime-lookup-is-not-a-function-in-expressjs-run-inside-docker https://stackoverflow.com/questions/60740950/mime-lookup-is-not-a-function-in-node-js

PS: Fixing it by renaming .lookup() to .getType() might temporarily solve the issues, but switching to mime-types makes a lot of sense in the long run.

brettz9 commented 3 years ago

Since the main issue has been resolved (changing to getType), and since we have also upgraded to mime@2 which has since made fixes, I figure this can be closed. Feel free to comment further if needed. Thanks!