Created
July 10, 2014 12:36
-
-
Save ctmay4/3cfa6ffdee448df0f116 to your computer and use it in GitHub Desktop.
Proxy requests with Node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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