https://github.com/antonreshetov/all-origins
Cross origin domain access
https://github.com/antonreshetov/all-origins
Last synced: 8 months ago
JSON representation
Cross origin domain access
- Host: GitHub
- URL: https://github.com/antonreshetov/all-origins
- Owner: antonreshetov
- License: mit
- Created: 2018-05-18T07:07:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-18T08:02:17.000Z (over 7 years ago)
- Last Synced: 2025-01-03T20:12:38.758Z (10 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# All origins
A simple server that allows cross-domain requests for later use.
## Usage
Use on you own server or local host for testing
### Install
```bash
# Clone the repo
git clone https://github.com/antonreshetov/all-origins.git# Install dependencies
cd all-origins
npm i# Start server (by default port is 3020)
npm start
```### Use
On server start pass the url in query string `?url=` to your host to get the result of the request:
```
http://localhost:3020/?url=http://example.com
```Use any tool for HTTP requests on client to get the results of the request for their own purposes.
**Example:**
Fetch pretty gorgis from instagram πΆπ
```js
fetch(
'http://localhost:3020/?url=https://www.instagram.com/corgis_of_instagram'
)
.then(res => res.json())
.then(res => {
let result = JSON.parse(
res.data
.split('window._sharedData = ')[1]
.split(';')[0]
.replace(/\\"/g, '"')
)
result = result.entry_data.ProfilePage[0].graphql.user.edge_owner_to_timeline_media.edges.map(
item => item.node.thumbnail_src
)console.log(result)
})
```## License
MIT Β© 2018-present [Anton Reshetov](https://github.com/antonreshetov)