Skip to content

Instantly share code, notes, and snippets.

@ityshchenko
ityshchenko / server.js
Created December 12, 2018 15:41 — forked from mrded/server.js
CORS Proxy on node.js + express
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);
});