Skip to content
/ shortener Public template

A worker that redirects URIs based on Cloudflare KV Store

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT
Notifications You must be signed in to change notification settings

gavdaly/shortener

URI shortener Template

A template for generating a quick url shortener with a Cloudflare worker.

Wrangler

To generate using wrangler

wrangler generate ShortenerName https://github.com/gavdaly/shortener

Further documentation for Wrangler can be found here.

Change the settings

  1. Cope the destination below or copy the wrangler.example.toml to wrangler.toml
  2. Create two KV name spaces, one for production and one for preview.
  3. Copy the namespaces id and add it to the kv_namespaces
  4. Get your account id and zone id
  5. Copy them to the toml file
  6. run wrangler publish
name = "cfshornener"
type = "javascript"
account_id = ""
workers_dev = true
route = "/"
zone_id = ""
kv_namespaces = [
    {binding = "shortener", id = "", preview_id = ""}
]

About

A worker that redirects URIs based on Cloudflare KV Store

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Code of conduct

Stars

Watchers

Forks