This is a link shortener that runs as a Cloudflare Worker.
-
Ensure Wrangler is installed on your local machine and authenticate with Cloudflare:
$ npm i @cloudflare/wrangler -g $ wrangler login
-
Create the Workers KV namespace for the shortener:
$ wrangler kv:namespace create "SHORTY" $ wrangler kv:namespace create "SHORTY" --preview
Copy the
id
you get in the terminal output towrangler.toml
in place ofID_HERE
, and copy thepreview_id
you get in the terminal output in place ofPREVIEW_ID_HERE
. -
Deploy the Worker:
wrangler publish
.