Closed niebieskiRydz closed 1 year ago
Hello, I am developing app in React.js
I installed cors-anywhere and imported it with: const cors_proxy = require('cors-anywhere');
const cors_proxy = require('cors-anywhere');
I have set the host and the port.
When I'm trying to use: 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); });
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); });
I get an error: Uncaught (in promise) TypeError: __webpack_require__(...).createServer is not a function createServer cors-anywhere.js:424
Uncaught (in promise) TypeError: __webpack_require__(...).createServer is not a function
createServer cors-anywhere.js:424
Do you have any idea what can I do to make it work?
Thank you in advance.
This is a Node.js library that should run on a server. It doesn't work in a web browser.
It works well now on a server. Thank you.
Hello, I am developing app in React.js
I installed cors-anywhere and imported it with:
const cors_proxy = require('cors-anywhere');
I have set the host and the port.
When I'm trying to use:
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); });
I get an error:
Uncaught (in promise) TypeError: __webpack_require__(...).createServer is not a function
createServer cors-anywhere.js:424
Do you have any idea what can I do to make it work?
Thank you in advance.