request-type
v0.0.1
Published
Node.js Content-Type checking middleware.
Downloads
4
Maintainers
Readme
request-type
Node.js Content-Type checking middleware.
Install
NPM
$ npm install request-type
Node.js
var express = require('express');
var requestType = require('request-type');
var app = express();
app.post('/', requestType('application/*'), function(req, res, next) {
res.send('Success!');
});
app.put('/', requestType(['application/json', 'application/xml']), function(req, res, next) {
res.send('Wunderbar!');
});