https://github.com/ltla/simple-cors-proxy
Simple CORS proxy for GETting in web apps
https://github.com/ltla/simple-cors-proxy
Last synced: about 1 year ago
JSON representation
Simple CORS proxy for GETting in web apps
- Host: GitHub
- URL: https://github.com/ltla/simple-cors-proxy
- Owner: LTLA
- License: mit
- Created: 2022-03-04T05:37:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-09T21:39:14.000Z (over 3 years ago)
- Last Synced: 2025-02-10T12:29:47.554Z (over 1 year ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple CORS proxy
A very simple CORS proxy to `GET` various things without having to worry about... well, CORS.
The original aim as to retrieve files and such from GitHub (e.g., Artifacts and what-have-you);
specifically, this was created to support the [**kana**](https://github.com/jkanche/kana) application, to allow it to grab stuff from GitHub for free.
Usage is very simple: hit the endpoint with an encoded URI and the proxy will do a `fetch`, passing back the contents and the content type.
For example:
```js
let base = "https://cors-proxy.aaron-lun.workers.dev";
let target = "https://github.com/LTLA/singlepp-references/releases/download/hs-latest/NovershternHematopoietic_matrix.csv.gz";
let full = base + "/" + encodeURIComponent(target);
// Get the full file.
let X = await fetch(full)
// Range requests.
let X2 = await fetch(base + "/" + encodeURIComponent(target) + "?start=100&end=200")
```