June 2014
Intermediate to advanced
696 pages
38h 52m
English
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.');});
Read now
Unlock full access