mimeware

Node.js HTTP server middleware to infer and define the proper MIME content type as response header
It works in multiple web frameworks such as Connect, Express, Restify, Sails...
which implements the standard connect-based middleware interface: use(function (req, res, next) { ... })
Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. Uses node-mime
It was implemented specially for older Express/Connect versions
Installation
npm install mimewire --save
Usage
var express = require('express')
var mimewire = require('mimewire')
var app = express()
app.use(mimewire({ defaultType: 'text/html' }))
app.get('/hello', function (req, res, next) {
res.send('Hello World!')
})
Options
defaultType
Type: string
Type: text/html
Define the default MIME type to use if cannot infer it
ignore
Type: array<string|regex>
An array of regex or string-like path patterns to ignore
charset
Type: boolean
Default: true
Define the proper encoding charset if required
License
MIT © Tomas Aparicio