I use the following node-express code to proxy requests from a web server to an API server:
app.use(\'/api\', function(req, res) { var url = \'http://my.do
In the case of a post request, the following construct works:
app.post('/api/method', (req, res) => { req.pipe(request.post(someUrl, { json: true, body: req.body }), { end: false }).pipe(res); }
This is of course relevant if you're using the bodyparser middleware.