I am trying to make cors-anywhere to work in my nodejs/express without success.
First I use express-cors-anywhere
like this :
const anywhere = require('express-cors-anywhere')
app.use("/cors-anywhere", anywhere())
but get the following error :
anywhere is not a function
I've tried to use the native cors-anywhere
library but I don't know how to implement this on an express js app :
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);
});
Any suggestion ?
How to integrate with existing expressjs server #81