Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.48 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.48 KB

url-shortener

  • This API converts a long website links to short (like goo.gl,bit.ly).

Prerequisites

  • Node.js
  • NPM
  • Express

Installation

  • Clone the project

  • Run given commands to the project directory

  • This command will install all require packages

npm install

  • This command will start server in localhost and deploy the API on it (basically will run app.js file).
node app

How to use

  • Now API is running on localhost. One can call the API from anywhere (like in own program or Postman), I am using cURL.
  • User has to call the api with POST method at end-point api/shorten (call with JSON object, key name is fullURL and value is Website's Long Link)

  • It will return the JSON object. In this object, "url" key has short url.
  • Now insert "localhost:<port_number>/<short_url>" into browser and it will redirect it to original url.

Authors

  • Keval S. Navadiya