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
idyou get in the terminal output towrangler.tomlin place ofID_HERE, and copy thepreview_idyou get in the terminal output in place ofPREVIEW_ID_HERE. -
Deploy the Worker:
wrangler publish.