Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

choonkeat/elm-serverless-edge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: this repo is an early iteration of elm-webapp. ideally we re-introduce a cloudflare workers runtime to 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.

Screenshot 2019-09-21 at 10 42 51 AM

Setup

  1. After logging into cloudflare click on Get started with Workers, or go to https://dash.cloudflare.com/{account_id}/workers/kv/namespaces
  2. Click on KV and add a namespace; copy and paste the id into wrangler.toml under [[kv-namespaces]] > id
  3. Click on Workers tab on top and create a worker; set the worker name in your wrangler.toml
  4. 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 effect

After these are setup, you can make preview locally; your browser will automatically load a page running your worker on Cloudflare.

About

Elm on Cloudflare Workers & KV store

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published