Created
December 4, 2015 16:17
-
-
Save mrded/540aa79a42f74a4911e8 to your computer and use it in GitHub Desktop.
Revisions
-
mrded created this gist
Dec 4, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ var express = require('express'), request = require('request'); var app = express(); // Forward all requests from /api to http://foo.com/api app.use('/api', function(req, res) { req.pipe(request("http://foo.com/api" + req.url)).pipe(res); }); app.listen(process.env.PORT || 3000);