How to use `bodyParser.raw()` to get raw body?
<p>I am creating a web API using <code>Express</code>.
The feature is to allow API users to send a file to the server.</p>

<p>Here's my app setup code:</p>

<pre><code>var express = require('express');
var path = require('path');
// ...
var bodyParser = require('body-parser');

var routes = require('./routes/index');
var users = require('./routes/users');

// API routes
var images = require('./routes/api/img');

var app = express();

app.use(bodyParser.raw());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', routes);
app.use('/api', images);

// ...

module.exports = app;
</code></pre>

<p>Please notice that I am using <code>app.use(bodyParser.raw());</code>.</p>

<p>How do I get the raw bytes from POST requests?</p>

<pre><code>const express = require('express');
const router = express.Router();

/* POST api/img */
router.post('/img', function(req, res, next) {

  // how do I get the raw bytes?

});

module.exports = router;
</code></pre>