Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 876 Bytes

README.md

File metadata and controls

35 lines (28 loc) · 876 Bytes

URL-Shortener

Simple URL Shortener using Express and MongoDB.

Initial settings

Dependencies

  • express
  • moongose
  • ejs
  • shortid
npm install express mongoose ejs shortid

Development Dependencies

  • nodemon
npm install nodemon -D

Scripts

"scripts": {
    "dev": "nodemon server.js"
},

Description

  • We use ejs to simplify html render with variables.
  • Each time a user "post" at /shortUrls, Express will catch the fullUrl parameter, and then send it to the MongoDB.
  • In the creation process, it will create a random short id (with shortid dependency) and save it in the cloud.
  • Each time a user "get" at /, the user will recieve a list with all the urls shortered. Ejs helps with the html.
  • Each time a user "get" at /:shortUrl (enters to a url shortered), the "clicks" counter will increment by 1.