Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: cors-anywhere
node v8.17.0
version:
1.0.0
endpoint
share
tweet
// 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('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); });
Created from: https://npm.runkit.com/cors-anywhere
Loading…
no comments
sign in
to comment