Skip to content
/ route Public

A URL shortening service running on Cloudflare Workers using Cloudflare KV as a store

License

Notifications You must be signed in to change notification settings

nataz77/route

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Route ➡️📍🔁

This is a very simple URL shortening services running on Cloudflare Workers using Cloudflare KV to store URL data

Get started

Worker deploy

  • Clone the repo
  • If you don't have it installed, install the wrangler cli
  • Login to your Cloudflare account via wrangler login
  • Deploy via wrangler publish

KV Management

  • In the Cloudflare Workers dashboard, create a new KV namespace (you can freely choose a name at this time)
  • Open the deployed worker and in the Settings tab, bind the created namespace to the route variable

Bonus steps

  • Disable the workers.dev endpoint and link it to a domain (eg. route.example.com)

URL management

In the Cloudflare Workers dashboard, open the KV namespace you just created and for each URL you want to be shortened add an entry in the table (eg. if you insert hello as the key and https://example.com as the value, calling https://WORKERENDPOINT/hello will redirect you to https://example.com)

Why Cloudflare Workers?

  • It's easy to setup
  • The free tier has 100k requests per day (which is a lot!)
  • Runs on the global Cloudflare Network
  • Took 12 lines of code to create this service (could take even less)

About

A URL shortening service running on Cloudflare Workers using Cloudflare KV as a store

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages