A simple CORS proxy server for bypassing CORS restrictions when consuming APIs. Useful for working around CORS issues in development environments.
npm install
npm start
This will start the proxy server on port 8080.
To proxy requests, prefix the API URL with the proxy URL:
http://localhost:8080/https://api.example.com/endpoint
The proxy will forward requests to the target API and handle CORS headers.
The proxy server is based on cors-anywhere. See the project documentation for how to configure origins, headers, etc.
Edit main.js
to modify the proxy behavior as needed.
The proxy can be deployed to any Node.js hosting platform like Heroku, AWS, Azure, etc. Configure the platform to run npm start
to start the server.
Set the PORT environment variable to configure the proxy port as needed.
- TODO: Add PORT environment variable
This project is MIT-licensed. See LICENSE.
cors-anywhere package by Rob--W.