Skip to content

louiswilliams/urlshorten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Super lightweight url shortener

Zero configuration url shortener and API.

Requires a MongoDB Server running on port 27017.

Live example site: http://s.louiswilliams.org/

API

GET /c/:url (Create shortened url)

  • Input

    • url: Input URL to shorten
  • Output (JSON)

    • hash: Hash of the url

    • url: Shortened URL

GET /g/:hash (Decode hash)

  • Input

    • hash: Input hash to get original URL
  • Output (JSON)

    • url: Original URL

GET /:hash (Decode and redirect)

  • Input

    • hash: Input hash to get original URL
  • Output

    • Redirect to original URL

Install

npm install

Deploy

Defaults to port 3003. Modify in server.js

npm start

About

Lightweight URL shortener and API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published