]> git.ardis.lu - ardislu.dev/commitdiff
Move wrangler bindings to .dev.vars
authorArdis Lu <ardisglu@gmail.com>
Mon, 11 Jul 2022 01:43:30 +0000 (18:43 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 11 Jul 2022 01:43:30 +0000 (18:43 -0700)
Currently this is an undocumented feature only available in the beta

.dev.vars.example [new file with mode: 0644]
.gitignore [new file with mode: 0644]
README.md

diff --git a/.dev.vars.example b/.dev.vars.example
new file mode 100644 (file)
index 0000000..63dc5c2
--- /dev/null
@@ -0,0 +1,3 @@
+EMAIL="example@example.com"
+PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...EXAMPLE...\n-----END PRIVATE KEY-----\n"
+SCOPES="https://www.googleapis.com/auth/spreadsheets.readonly https://www.googleapis.com/auth/documents.readonly"
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..20bf020
--- /dev/null
@@ -0,0 +1,2 @@
+.dev.vars
+node_modules
index e3dfcb984b1a5bad29b77e9b730d83316d54f01a..5f98dbd9769eed3bdfd196e5a64ab85c1244183d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -14,10 +14,10 @@ Once I fetch an article from the Google Docs API, the article is converted into
 
 ## Local development
 
-Use the `wrangler` CLI to serve the static frontend and API at the same time. Provide credentials for a service account with access to the Google Docs as environment variables.
+Use the `wrangler` CLI to serve the static frontend and API at the same time.
 
-From the [Cloudflare Pages documentation](https://developers.cloudflare.com/pages/platform/functions/#develop-and-preview-locally):
+1. Copy `.dev.vars.example` and rename it to `.dev.vars`. Provide an email and private key for a service account with access to the Google Docs and Google Sheet.
 
-1. `npm i wrangler@beta`
+2. `npm i wrangler@beta`
 
-2. `npx wrangler pages dev . --binding EMAIL="example@example.com" PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...EXAMPLE...\n-----END PRIVATE KEY-----\n" SCOPES="https://example.com/auth/scope1 https://example.com/auth/scope2"`
+3. `npx wrangler pages dev .`
This page took 0.047281 seconds and 4 git commands to generate.