Readme

🔗 Short URL Generator

A simple, serverless short URL generator built on Val Town using React and SQLite.

Features

  • 🌐 Generate short URLs for any long URL
  • 💾 Persistent storage using SQLite
  • 🚀 Instant redirection
  • 🎨 Clean, minimal React interface

How It Works

  1. Enter a long URL in the input field
  2. Click "Generate Short URL"
  3. Receive a unique, short URL
  4. Share and use the short URL, which will redirect to the original link

Technical Details

  • Built with React (client-side)
  • Uses Val Town's SQLite for URL mapping storage
  • Generates a random 5-character short code
  • Serverless deployment on Val Town

Example

Long URL: `https://very-long-url.com/with-many-parameters\` Short URL: `https://your-val-domain.web.val.run/ab123\`

Limitations

  • Short codes are randomly generated (potential for rare collisions)
  • No custom short code option
  • URLs are stored indefinitely

Source

[View Source](${import.meta.url.replace("esm.town", "val.town")})

Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
cocodrilette-shorturl.web.val.run
Updated: December 25, 2024