Trying to run cors-anywhere locally

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-14 00:24:10 +02:00
parent 5a067af725
commit ee4fd62c0c
47 changed files with 3754 additions and 4 deletions

View File

@@ -34,6 +34,17 @@ var port = 3000;
var lists = {};
var unique_ids = [];
var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1';
var cors_proxy = require('cors-anywhere');
cors_proxy.createServer({
requireHeader: ['origin', 'x-requested-with'],
removeHeaders: ['cookie', 'cookie2']
}).listen(8080, host, function() {
console.log('Running CORS Anywhere on ' + host + ':' + 8080);
});
server.listen(port, function () {
console.log('Server listening at port %d', port);
});