Skip to content

extwiii/URLSHortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener Microservice

User stories:

  1. I can pass a URL as a parameter and I will receive a shortened URL in the JSON response.
  2. When I visit that shortened URL, it will redirect me to my original link.

Example usage:

https://extwiii-urlshortener.herokuapp.com/new/https://www.google.com
https://extwiii-urlshortener.herokuapp.com/new/https://www.twitter.com

Example output:

{"originalUrl":"http://www.google.com","shortUrl":"https://extwiii-urlshortener.herokuapp.com/685"}
{"originalUrl":"http://www.twitter.com","shortUrl":"https://extwiii-urlshortener.herokuapp.com/985"}

Usage:

https://extwiii-urlshortener.herokuapp.com/985

Will redirect to:

https://twitter.com/

Tools / Techniques

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • valid-url

Difficulty 🌕🌕🌕🌕🌕🌕🌕🌑🌑🌑

Created By Bilal Cagiran | E-Mail | Github | LinkedIn | CodePen | Blog/Site | FreeCodeCamp