Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/choonkeat/elm-serverless-edge
Elm on Cloudflare Workers & KV store
https://github.com/choonkeat/elm-serverless-edge
Last synced: 27 days ago
JSON representation
Elm on Cloudflare Workers & KV store
- Host: GitHub
- URL: https://github.com/choonkeat/elm-serverless-edge
- Owner: choonkeat
- Archived: true
- Created: 2019-09-08T06:07:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-16T00:47:24.000Z (about 3 years ago)
- Last Synced: 2024-08-03T03:03:31.437Z (4 months ago)
- Language: Elm
- Homepage: https://elm.choonkeat.workers.dev/
- Size: 11.7 KB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
_NOTE: this repo is an early iteration of [elm-webapp](https://github.com/choonkeat/elm-webapp). ideally we re-introduce a cloudflare workers runtime to [elm-webapp](https://github.com/choonkeat/elm-webapp) instead_
# Elm on Cloudflare Workers with KV
Elm is a perfect fit actually, since you can hardly do anything other than HTTP and accessing the Cloudflare KV store.
# Setup
1. After logging into cloudflare click on `Get started with Workers`, or go to `https://dash.cloudflare.com/{account_id}/workers/kv/namespaces`
1. Click on `KV` and add a namespace; copy and paste the `id` into `wrangler.toml` under `[[kv-namespaces]] > id`
1. Click on `Workers` tab on top and create a worker; set the worker name in your wrangler.toml
1. Click on `{} Editor` > `KV` tab > `+ Add binding` button to bind your KV namespace to a JS global variable name (the variable name can be different from the namespace name)
- i _think_ you'll need to `Save and deploy` button below for it to take effectAfter these are setup, you can `make preview` locally; your browser will automatically load a page running your worker on Cloudflare.