Skip to content

πŸ‘·πŸ»β€β™‚οΈ Cloudflare Worker to update GitHub Gists with ease

License

Notifications You must be signed in to change notification settings

EstebanBorai/gist-updater-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

gist-updater-worker

πŸ‘·πŸ»β€β™‚οΈ Cloudflare Worker to update GitHub Gists with ease


Deploy to Cloudflare Workers

Motivation

Create a Worker to update, reset and read JSON data from a GitHub Gist.

Usage

This worker will handle GET, POST and DELETE requests acting on an specific GitHub Gist. Any other method will result on 405 status code for Method Not Allowed.

  • To get the current status of the gist, you must fetch GET /.
  • To append a new object to the gist, you must fetch POST /, with the payload to append as the request body.
  • To clean up the array of objects, you must fetch DELETE /. This will empty the array of objects.

Keep in mind that every time a gist is updated, a new revision is made, just like a commit. This results in something like a commit history for your gist.

Handlers

Method URI Req. Body Res. Body
GET / N/A object[]
POST / object N/A
DELETE / N/A []

Environment Variables

All of these environment variables are configured either by editing the wrangler.toml file or by configuring your worker environment variables from the Cloudflare website.

Name Description Default Value
GITHUB_AUTHENTICATION GitHub Personal Access token with Gist Only Access N/A
GIST_URL URL to the gist N/A
FILENAME Name of the file from the gist N/A
USER_AGENT User-Agent HTTP Header Value. Required by GitHub's API Cloudflare Worker

License

MIT License

About

πŸ‘·πŸ»β€β™‚οΈ Cloudflare Worker to update GitHub Gists with ease

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published