You can also apply body-parser
middleware to a single route by passing it after the path
parameter. For example, in the following code, requests to /parsedRoute
will be logged, but requests to /otherRoute
will not be logged:
var express = require('express'),
var bodyParser = require('body-parser'),
var app = express();
app.get('/parsedRoute', bodyParser(), function(req, res) {
res.send('This request was logged.'),
});
app.get('/otherRoute', function(req, res) {
res.send('This request was not logged.'),
});