Skip to content

Instantly share code, notes, and snippets.

@ctmay4
Created July 10, 2014 12:36
Show Gist options
  • Save ctmay4/3cfa6ffdee448df0f116 to your computer and use it in GitHub Desktop.
Save ctmay4/3cfa6ffdee448df0f116 to your computer and use it in GitHub Desktop.
Proxy requests with Node
var request = require('request');
var appUrl = 'https://api.seer.cancer.gov/rest/';
app.use('/api', function(req, res) {
url = apiUrl + req.url;
req.pipe(request(url)).pipe(res);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment