/URLSHortener

URL SHortoner API

Primary LanguageHTMLApache License 2.0Apache-2.0

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