Files
cors-anywhere/server.js
2013-01-03 21:26:03 +01:00

13 lines
477 B
JavaScript

// Heroku defines the environment variable PORT, and requires the binding address to be 0.0.0.0
var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1';
var port = process.env.PORT || 8080;
var cors_proxy = require("./lib/cors-anywhere");
cors_proxy.createServer({
requireHeader: 'x-requested-with',
withCredentials: false,
removeHeaders: ['cookie', 'cookie2']
}).listen(port, host, function() {
console.log('Running CORS Anywhere on ' + host + ':' + port);
});