Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudflare/worker-template-fetch
https://github.com/cloudflare/worker-template-fetch
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cloudflare/worker-template-fetch
- Owner: cloudflare
- Created: 2019-04-26T21:28:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T22:49:39.000Z (about 1 month ago)
- Last Synced: 2024-10-04T21:41:28.588Z (about 1 month ago)
- Language: JavaScript
- Size: 563 KB
- Stars: 20
- Watchers: 8
- Forks: 11
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cloudflare - Fetch - Examples of making fetch requests and generating JSON post requests. (Workers / Recipes)
- awesome-cloudflare - Fetch - Examples of making fetch requests and generating JSON post requests. (Workers / Recipes)
README
## fetch
Examples of making fetch requests from within your Worker script including generating JSON post requests then reading in the resulting response body, aggregating multiple requests into one response, and following/catching redirects.
[`index.js`](https://github.com/cloudflare/worker-template-fetch/blob/master/index.js) is the content of the Workers script.
#### Wrangler
To generate using [wrangler](https://github.com/cloudflare/wrangler)```
wrangler generate myApp https://github.com/cloudflare/worker-template-fetch
```#### Serverless
To deploy using serverless add a [`serverless.yml`](https://serverless.com/framework/docs/providers/cloudflare/) file.