Skip to content

Instantly share code, notes, and snippets.

@ibare
Created April 12, 2017 06:00
Show Gist options
  • Save ibare/de494cd90d2f8a0a9c11713dbd30cede to your computer and use it in GitHub Desktop.
Save ibare/de494cd90d2f8a0a9c11713dbd30cede to your computer and use it in GitHub Desktop.
app.all('/v1/*', (req, res) => {
request[req.method.toLowerCase()]({
url: config.ApiServer+req.url,
headers: {
'Authorization': req.headers['authorization'],
'Content-Type': req.headers['content-type']
},
qs: req.query,
json: req.body
}, (err, response, body) => {
res.status(response.statusCode).send(body);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment