11 lines
364 B
JavaScript
11 lines
364 B
JavaScript
|
const host = process.env.HOST || "0.0.0.0"; // The host to bind to
|
||
|
const port = process.env.PORT || 8080; // The port to bind to
|
||
|
require("cors-anywhere")
|
||
|
.createServer({
|
||
|
originWhitelist: [], // Allow all origins
|
||
|
requireHeader: ["origin", "x-requested-with"],
|
||
|
})
|
||
|
.listen(port, host, function () {
|
||
|
console.log(`CORS Proxy started on ${host}:${port}`);
|
||
|
});
|