Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

mellowmarshe/link-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

link-shortener

link-shortener is a simple URL shortener for Cloudflare workers!

Installation

To start, clone this repository and after:

# Install NPM packages
$ npm install
# Fill out `wrangler.example.toml` with the necessary information then rename it
$ mv wrangler.example.toml wrangler.toml
# Add secret to worker
$ npm run secret
# Deploy worker
$ npm run deploy

Usage

To PUT a new link

curl -X PUT http://127.0.0.1:8787 \
    -H "Authorization: SECRET" \
    -d '{"url": "URL"}'

DELETE a link

curl -X DELETE http://127.0.0.1:8787/ID \
    -H "Authorization: SECRET"

Todo

  • Support DELETE to delete a link
  • Route to list all links
  • Add link specific TTLs
  • Maybe a hit tracker 👀

About

A link shortener for Cloudflare workers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published