From ef2943926f906a05487d16bb18fd377014772f08 Mon Sep 17 00:00:00 2001 From: Rudy Chung Date: Fri, 18 Nov 2022 13:55:08 -0500 Subject: [PATCH 1/2] Move Cloudflare Workers instructions --- CONTRIBUTING.md | 7 +++++-- worker/index.js | 9 --------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c6d847..546dcef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,10 @@ To start the local site use: To deploy updated versions: `npm run deploy` +# Using Cloudflare Workers +1. Run `npx wrangler dev src/index.js` in your terminal to start a development server +1. Open a browser tab at http://localhost:8080/ to see your worker in action +1. Run `npx wrangler publish src/index.js --name my-worker` to publish your worker - - +Learn more at https://developers.cloudflare.com/workers/ diff --git a/worker/index.js b/worker/index.js index ab2d5f2..2953c4e 100644 --- a/worker/index.js +++ b/worker/index.js @@ -1,12 +1,3 @@ -/** - * Welcome to Cloudflare Workers! This is your first worker. - * - * - Run `npx wrangler dev src/index.js` in your terminal to start a development server - * - Open a browser tab at http://localhost:8080/ to see your worker in action - * - Run `npx wrangler publish src/index.js --name my-worker` to publish your worker - * - * Learn more at https://developers.cloudflare.com/workers/ - */ import { onRequestPost } from "./functions/on-req-post"; import { StatusCodes } from "http-status-codes"; From a6c15554320d798ab30ae99425f7a401a50fa1b0 Mon Sep 17 00:00:00 2001 From: Rudy Chung Date: Fri, 18 Nov 2022 15:43:10 -0500 Subject: [PATCH 2/2] Update scripts to be more generic --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 546dcef..546adbd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,8 @@ To deploy updated versions: # Using Cloudflare Workers -1. Run `npx wrangler dev src/index.js` in your terminal to start a development server +1. Run `npx wrangler dev ` in your terminal to start a development server 1. Open a browser tab at http://localhost:8080/ to see your worker in action -1. Run `npx wrangler publish src/index.js --name my-worker` to publish your worker +1. Run `npx wrangler publish --name ` to publish your worker Learn more at https://developers.cloudflare.com/workers/