Skip to content

kevinnorris/urlShortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Third Backend API project for freeCodeCamp

URL shortener

Usage

To shorten a url pass it as a parameter to the apps url as follows [appUrl]/new/[urlToShorten]

  • [appUrl] is the url of the application
  • [urlToShorten] is the url you wish to shorten

The API will return a JSON object as follows: {"original_url": [urlToShorten], "short_url": [shortUrl]}

Or an error if something went wrong: {"error": [error message]}


Shortening Method

I chose to use Bijective functions to encode the database entries auto incrementing ID.

Pros

  • This method provides the shortest url's
  • This method is the most efficient, no possible collisions (as with hashing), no required db lookups to insert, new links are always added to the end of the db

Cons

  • Users can easily browse all links that have been shortened
  • Users are unable to choose their own url path for shortened links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published