Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”— URLShorter

URLShorter Preview

⚑ Fast β€’ πŸ”’ Secure β€’ 🎨 Modern URL Shortening

A professional, responsive URL shortening service powered by Cloudflare Workers.


πŸš€ Open URLShorter Β Β β€’Β Β  πŸ”— Try Example


✨ Features

  • ⚑ Lightning-fast URL shortening
  • πŸ”— Clean, shareable short links
  • πŸ“‹ One-click Copy button for generated URLs
  • πŸ“± Fully responsive on mobile, tablet and desktop
  • β˜€οΈ Light Mode enabled by default
  • πŸŒ™ Beautiful Dark Mode
  • πŸ›‘οΈ Optional security/CAPTCHA integration
  • πŸ” Optional URL safety checking
  • ♻️ Unique short links
  • ⏱️ Optional link expiration
  • 🌐 CORS support
  • 🎨 Modern animated interface
  • πŸš€ Cloudflare Worker deployment

🌐 Example Short URL

https://go.abdullah.nyc.mn/ANiFZm


πŸ“Έ Website Preview

URLShorter Full Website Preview

πŸš€ Getting Started

☁️ Quick Cloudflare Worker Setup

1. πŸ“¦ Create a Workers KV Namespace

Open Cloudflare Dashboard β†’ Workers & Pages β†’ KV and create a new KV namespace.

Choose any name you like. For example:

links

πŸ“Έ Example:

Cloudflare Worker Settings


2. πŸ”— Bind the KV Namespace to Your Worker

Open your Worker and go to:

Settings β†’ Variables β†’ KV Namespace Bindings

Add a KV binding.

Variable name:

LINKS

Then select the KV namespace you created in the previous step.

πŸ“Έ Example:

Cloudflare KV Binding

βœ… The Worker code expects the KV binding variable to be named LINKS.


3. πŸ“ Copy the Worker Code

Open the Worker source file in this project and copy the complete Worker code.

Then open your Cloudflare Worker and replace the existing code with the copied code.


4. βš™οΈ Configure the Worker

The main settings are inside the config object.

Example:

const config = {
  no_ref: "off",
  theme: "theme/captcha",
  cors: "on",
  unique_link: true,
  custom_link: false,
  safe_browsing_api_key: "",
  expiration_ttl: 0,

  captcha: {
    enabled: true,
    require_on_create: true,
    require_on_access: true,
    timeout: 5000,
    fallback_on_error: true,
    max_retries: 2
  }
};

πŸ” CAPTCHA

CAPTCHA is configurable directly from the Worker settings.

You can enable or disable it with:

captcha: {
  enabled: true
}

The project does not require the old external demo/reference URLs.


5. πŸš€ Save and Deploy

After the KV binding and Worker code are ready:

Save β†’ Deploy

Then open your deployed Worker and test URL shortening.


πŸ§ͺ How to Use

  1. 🌐 Open your deployed URLShorter website.
  2. πŸ”— Paste a long URL into the input field.
  3. πŸ›‘οΈ Complete the security verification when required.
  4. ⚑ Click Shorten URL.
  5. βœ… Your Your short URL result will appear.
  6. πŸ“‹ Click Copy to copy the generated URL.
  7. πŸš€ Share your short link anywhere.

🎨 Interface

The modern interface includes:

  • 🧭 Professional sticky header
  • 🏠 Hero section
  • πŸ”— URL shortening form
  • βœ… Your short URL result card
  • πŸ“‹ Copy button
  • ⚑ Feature cards
  • πŸ› οΈ How It Works section
  • πŸ‘€ About section
  • β˜€οΈ Light Mode
  • πŸŒ™ Dark Mode
  • ⬆️ Back-to-top button
  • 🧾 Professional footer
  • πŸ“± Responsive mobile layout
  • 🎞️ Smooth animations

πŸŒ“ Theme

URLShorter starts in Light Mode by default.

Users can switch to Dark Mode from the header. The selected theme is stored locally so the preference remains on future visits.


πŸ”— Example / Demo Button

Use this example link:

https://go.abdullah.nyc.mn/ANiFZm


πŸ‘¨β€πŸ’» Developer

Abdullah Bin Shahid

🌐 Personal website:

http://abdullah.nyc.mn/

πŸ”— Example URLShorter link:

https://go.abdullah.nyc.mn/ANiFZm


βš™οΈ Configuration Options

Option Description
no_ref Controls referrer hiding
theme Homepage theme
cors Enables CORS
unique_link Reuses the same short URL for the same long URL
custom_link Enables custom short URLs
safe_browsing_api_key Optional URL safety checking
expiration_ttl Optional link expiration in seconds
captcha.enabled Enables/disables CAPTCHA
captcha.require_on_create CAPTCHA for link creation
captcha.require_on_access CAPTCHA for short-link access
captcha.fallback_on_error Allows degraded operation if CAPTCHA has an error

πŸ›‘οΈ Security Notes

For production use:

  • πŸ” Keep API keys private.
  • 🧱 Configure Cloudflare Worker bindings correctly.
  • πŸ›‘οΈ Keep security protection enabled when appropriate.
  • πŸ”Ž Test redirects before publishing.
  • 🚫 Never expose private credentials in frontend code.

πŸ“± Responsive Support

Designed for:

  • πŸ–₯️ Desktop
  • πŸ’» Laptop
  • πŸ“± Mobile
  • πŸ“² Tablet

The layout automatically adapts to different screen sizes.


πŸ“¦ Project Structure

URLShorter/
β”œβ”€β”€ index.js
β”œβ”€β”€ README.md
└── docs/
    β”œβ”€β”€ urlshorter-preview.png
    β”œβ”€β”€ cloudflare-worker-settings.png
    └── cloudflare-kv-binding.png

πŸ’œ URLShorter

Fast. Secure. Simple.

Built by Abdullah Bin Shahid


πŸš€ https://go.abdullah.nyc.mn/ANiFZm

Releases

Packages

Contributors

Languages