Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kristianfreeman/serverless-cloudflare-workers-blueprint
A blueprint for deploying Cloudflare Workers using the Serverless framework 🌥👷♀️
https://github.com/kristianfreeman/serverless-cloudflare-workers-blueprint
Last synced: about 1 month ago
JSON representation
A blueprint for deploying Cloudflare Workers using the Serverless framework 🌥👷♀️
- Host: GitHub
- URL: https://github.com/kristianfreeman/serverless-cloudflare-workers-blueprint
- Owner: kristianfreeman
- Created: 2019-04-18T15:08:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-22T15:51:58.000Z (over 5 years ago)
- Last Synced: 2024-11-02T19:03:21.189Z (about 1 month ago)
- Language: JavaScript
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless Cloudflare Workers Blueprint 🌥👷♀️
A blueprint for deploying Cloudflare Workers using the [Serverless framework](https://serverless.com/).
[![header](./media/header.png)](http://bit.ly/cf-workers-landing)
## Setup
You'll need your Cloudflare [API keys]() and zone ID (found on the Cloudflare Dashboard for your site) in order to deploy our Worker script from the command-line.
Below is a detailed description of each key/value pair in `.env` that should be populated before deploying your site:
```
# Your Cloudflare account id, available on the Cloudflare Dashboard
CLOUDFLARE_ACCOUNT_ID=""# Your Cloudflare account email
CLOUDFLARE_AUTH_EMAIL=""# Your Cloudflare auth key, available on your Cloudflare profile page
CLOUDFLARE_AUTH_KEY=""# Your Cloudflare zone id, available on the Cloudflare Dashboard
CLOUDFLARE_ZONE_ID=""# The route pattern for serving your Worker
WORKER_ROUTE="serverless-worker.signalnerve.com/*"
```Given these keys, make a file called [`.env`](https://github.com/signalnerve/serverless-workers-blueprint/blob/master/.env), using [`.env.example`](https://github.com/signalnerve/serverless-workers-blueprint/blob/master/.env) as a reference:
```
cp .env.example .env
```## Development
Serverless:
```
npm install -g serverless
npm install
```Deploy your worker to your Cloudflare account:
```
serverless deploy
```Go to your configured URL to confirm that your website is being served with Cloudflare Workers!