Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.46 KB

README.md

File metadata and controls

41 lines (27 loc) · 1.46 KB

URL Shortener API 🔗

Made with Node.js, Express and MongoDB

How To Install

  1. Install the dependecies with npm install
  2. Go to config folder and modify the default.json file with your MongoURI and BaseURL (You can use localhost)
  3. node start

How To Use

POST api/url/shorten

To make a post request you can use Postman or if you are using VScode you can download the REST Client Extension for Visual Studio Code.

  • For VScode you can use the api.http file located at the requests folder and insert a long url. Example

MongoDB

  • If you have Docker installed you can pull a MongoDB image and connect the app to your database container.

    docker pull mongo:latest
    docker run -d -p 27017:27017 --name mongodb mongo

    Then, modify the default.json file like this:
    { "mongoURI": "mongodb://localhost:27017/urlshortener", "baseURL": "http://localhost:5000"}

  • Otherwise, you can use MongoDB Atlas or a local MongoDB

What I Learned

  • Node.js Concepts
  • Express Framework
  • MongoDB
  • Use Dependencies
  • How URL Shortener Services Work
  • Dockerized Database