A middleware to send files with a user-defined mime type.
This is a middleware to send files with a user-defined mime type.
express-custom-mime-types package is simply a function, which accepts one parameter:
options accepts one property:
mimes is an associative array.
Each property of the associative array represents the file extension with the value being the mime-type.
In the following example, we have our express.js app serve
*.underscore files as plain text.
var express = require'express';var app = express;appconfigure// ...appuserequire'express-custom-mime-types'mimes:'.underscore': 'text/plain';// ...;