Is it possible to setup CORS Anywhere on localhost?
- Install the latest node
- save the repo example code as cors.js (I'll paste it below)
- do
npm install cors-anywhere
- run
node cors
- now it's running on localhost:8080
sample code
// Listen on a specific host via the HOST environment variablevar host = process.env.HOST || '0.0.0.0';// Listen on a specific port via the PORT environment variablevar port = process.env.PORT || 8080;var cors_proxy = require('cors-anywhere');cors_proxy.createServer({ originWhitelist: [], // Allow all origins // requireHeader: ['origin', 'x-requested-with'], // removeHeaders: ['cookie', 'cookie2']}).listen(port, host, function() { console.log('Running CORS Anywhere on ' + host + ':' + port);});