Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nithinsgowda/pass-cors
A simple proxy to load CORS blocked image - NPM module
https://github.com/nithinsgowda/pass-cors
cors cors-proxy expressjs file-proxy nodejs npm proxy
Last synced: 26 days ago
JSON representation
A simple proxy to load CORS blocked image - NPM module
- Host: GitHub
- URL: https://github.com/nithinsgowda/pass-cors
- Owner: NithinSGowda
- Created: 2021-05-29T09:09:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-23T11:44:52.000Z (about 3 years ago)
- Last Synced: 2024-09-29T12:40:56.392Z (about 1 month ago)
- Topics: cors, cors-proxy, expressjs, file-proxy, nodejs, npm, proxy
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/pass-cors
- Size: 18.6 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **pass-cors**
**A simple proxy to load CORS blocked files**Must be used in an express server environment
```console
$ npm i pass-cors
```- Can be Used with any file type
- Just two lines of integration
- Eliminate third party proxy server dependency
- No need of a separate server to be hosted just for proxy
- This will function as a part of your current server and opens up a custom path set by the user
## Server Side
```javascript//Boilerplate
const express = require('express')
const app = express()//Main
const proxy = require('pass-cors')
app.use('/proxy', proxy); //You can customise the route name//Boilerplate
app.listen(process.env.PORT||8080)```
## Client Side
Before
```html```
After
```html```
Thats how easy it is to load a CORS blocked elements on your frontend