Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathas/restify-cors-dev-proxy
A proxy to solve CORS issues in development
https://github.com/jonathas/restify-cors-dev-proxy
cors cors-proxy javascript nodejs proxy proxy-server
Last synced: 25 days ago
JSON representation
A proxy to solve CORS issues in development
- Host: GitHub
- URL: https://github.com/jonathas/restify-cors-dev-proxy
- Owner: jonathas
- License: mit
- Created: 2020-09-09T17:28:20.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2020-09-09T17:30:02.000Z (over 4 years ago)
- Last Synced: 2024-11-16T06:28:26.927Z (3 months ago)
- Topics: cors, cors-proxy, javascript, nodejs, proxy, proxy-server
- Language: JavaScript
- Homepage:
- Size: 119 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.hbs
- License: LICENSE
Awesome Lists containing this project
README
# Restify CORS Dev Proxy
## Introduction
Have you ever had to work with an API that blocks origins which are not registered to be able to fetch content from it?
You try to access it from mobile apps and everything works fine, but then you also need to access it from a webapp, and there the famous CORS error shows up!
You try to use the famous CORS extension from Chrome to see if you can solve it, but still, nothing works as the origin is blocked in the API itself.Because of this, your local development experience is broken, as you'll either have to mock the required endpoints or upload the project to a temporary address which is an allowed origin in the API.
Or... you can use this script during development to make your life easier!
## Usage
1 - This will install the required packages and start the proxy server on port 3001:
```bash
npm start
```2 - You can find an example on how to use the proxy in the index.html file. You just need to implement something similar in your app.
## Limitations
Currently only works for GET requests. You can extend it to cover your use case and/or open a PR.