Skip to content

A retroactive compensation API built as a Cloudflare Worker.

Notifications You must be signed in to change notification settings

DA0-DA0/retroactive-compensation-cf-worker

 
 

Repository files navigation

retroactive-compensation-cf-worker

An API for a retroactive compensation system, built with Cloudflare Workers and Cloudflare D1.

Used template for Cosmos wallet authentication to authenticate requests via a Cosmos wallet signature.

Read through the design spec here.

Development

Run locally

npm run dev
# OR
wrangler dev --local --persist

Configuration

  1. Copy wrangler.toml.example to wrangler.toml.

  2. Create KV namespaces for production and development:

wrangler kv:namespace create NONCES
wrangler kv:namespace create NONCES --preview
  1. Update the binding IDs in wrangler.toml:
kv-namespaces = [
  { binding = "NONCES", id = "<INSERT NONCES_ID>", preview_id = "<INSERT NONCES_PREVIEW_ID>" }
]
  1. Create D1 database for production:
wrangler d1 create DB
  1. Update the binding ID in wrangler.toml:
[[ d1_databases ]]
binding = "DB"
database_name = "DB"
database_id = "<INSERT DB_ID>"
  1. Seed the database with:
npm run seed
# OR
wrangler d1 execute DB --file=./schema.sql
  1. Seed the local database with:
npm run seed:local
# OR
wrangler d1 execute DB --file=./schema.sql --local

Deploy

wrangler publish
# OR
npm run deploy

About

A retroactive compensation API built as a Cloudflare Worker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%