Package Exports
- content-types
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (content-types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
content-types 
handle multiple content types
Example
var http = create("http")
, contentTypes = require("routil-contentTypes")
http.createServer(function () {
contentTypes(req, {
"text/html": returnHtml
, "application/javascript": returnJson
})(req, res)
}).listen(8080)
function returnHtml(req, res) {
res.end("<ul><li>foo</li><li>bar</li></ul>")
}
function returnJson(req, res) {
res.end(JSON.stringify(["foo", "bar"]))
}Installation
npm install content-types
Tests
npm test
Contributors
- Raynos