A minimal url shortener made with cloudflare workers & workers KV.
No Javascript required on frontend.
Demo (Links expire in 1 hour).
Clone this repo first.
Install the dependencies.
npm install
Install miniflare.
npm i -g miniflare
Run miniflare.
miniflare
# Output
#✨ Built successfully, built project size is 2 KiB.
#[mf:inf] Build succeeded
#[mf:inf] Worker reloaded! (4.09KiB)
#[mf:inf] Listening on :8787
#[mf:inf] - http://127.0.0.1:8787
Install the wrangler cli
npm install -g @cloudflare/wrangler
Login to cloudflare workers
wrangler login
Create KV Namespace
wrangler kv:namespace create "fupi"
wrangler kv:namespace create "fupi" --preview
Copy the contents of the command to wrangler.toml
Publish to workers.dev
wrangler publish