https://github.com/ahmed-alnaqa/cloudflare-gateway
https://github.com/ahmed-alnaqa/cloudflare-gateway
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ahmed-alnaqa/cloudflare-gateway
- Owner: ahmed-alnaqa
- Created: 2021-01-30T23:21:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-30T23:22:11.000Z (over 4 years ago)
- Last Synced: 2025-03-13T06:14:23.807Z (2 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Router
Selects the logic to respond to requests based on the `request` method and URL. Can be used with REST APIs or apps that require basic routing logic.
[`index.js`](https://github.com/cloudflare/worker-template-router/blob/master/index.js) is the content of the Workers script.
#### Wrangler
You can use [wrangler](https://github.com/cloudflare/wrangler) to generate a new Cloudflare Workers project based on this template by running the following command from your terminal:
```
wrangler generate myapp https://github.com/cloudflare/worker-template-router
```Before publishing your code you need to edit `wrangler.toml` file and add your Cloudflare `account_id` - more information about publishing your code can be found [in the documentation](https://workers.cloudflare.com/docs/quickstart/configuring-and-publishing/).
Once you are ready, you can publish your code by running the following command:
```
wrangler publish
```#### Serverless
To deploy using serverless add a [`serverless.yml`](https://serverless.com/framework/docs/providers/cloudflare/) file.