Url shortening service with focus on blazing fast speeds. Deployed as a CloudFlare worker.
- Shortened id is saved after the respone to Workers KV (uses:
event.waitUntil()
) - Id is retrieved from CF-Ray header.
Check out this cool (and pretty useless) diagram about the service functionality!
Example:
account_id = "<YOUR_ACCOUNT_ID>"
name = "tinytf"
type = "webpack"
workers_dev = true
site = { bucket = "./public" }
compatibility_date = "2022-02-06"
kv_namespaces = [
{ binding = "TINY_TF", id = "YOUR_URL_DEV_SHORTENING_KV_NAMESPACE", preview_id = "YOUR_URL_DEV_SHORTENING_KV_NAMESPACE_PREVIEW" }
]
[env.production]
zone_id = "<YOUR_URL_SHORTENING_DOMAIN_ZONE>"
kv_namespaces = [
{ binding = "TINY_TF", id = "<YOUR_URL_PRODUCTION_SHORTENING_KV_NAMESPACE>", preview_id = "<YOUR_URL_PRODUCTION_SHORTENING_KV_NAMESPACE_PREVIEW>" }
]
route = "*<YOUR_SHORTENING_DOMAIN>/*"
wrangler dev
wrangler publish --env production