Giter Club home page Giter Club logo

url-shortener-nodejs's Introduction

url-shortener-nodejs

Stacks

Server Installation

cd src
npm install 

This will run server

npm run dev

API Endpoints

1. Create a Shortned Link (Post):
Request

https://url-shortener-api.onrender.com/api/v1/createShortUrl


##Ex.
https://url-shortener-api.onrender.com/api/v1/createShortUrl

body: {"origUrl": "https://www.amazon.in/dp/B088FLHXJY/ref=sspa_dk_detail_2?psc=1&pd_rd_i=B088FLHXJY&pd_rd_w=rwydj&content-id=amzn1.sym.b3dfef88-30a1-490c-be36-e990ef384667&pf_rd_p=b3dfef88-30a1-490c-be36-e990ef384667&pf_rd_r=TS7S5QC051GB8DD6K24J&pd_rd_wg=9qIGY&pd_rd_r=525a9dc4-2bbc-4caa-b909-13f2a0e685fd&s=electronics&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWw",} Response

{
    "_id": "63df3a37d9737b067d032433",
    "urlId": "l2bz27uQfrydC5BiUxyIJ",
    "origUrl": "https://www.amazon.in/dp/B088FLHXJY/ref=sspa_dk_detail_2?psc=1&pd_rd_i=B088FLHXJY&pd_rd_w=rwydj&content-id=amzn1.sym.b3dfef88-30a1-490c-be36-e990ef384667&pf_rd_p=b3dfef88-30a1-490c-be36-e990ef384667&pf_rd_r=TS7S5QC051GB8DD6K24J&pd_rd_wg=9qIGY&pd_rd_r=525a9dc4-2bbc-4caa-b909-13f2a0e685fd&s=electronics&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWw",
    "shortUrl": "https://url-shortener-api.onrender.com/l2bz27uQfrydC5BiUxyIJ",
    "clicks": 3,
    "createdAt": "2023-02-05T05:10:15.202Z",
    "updatedAt": "2023-02-05T05:13:28.194Z",
}

2. Get Main URL from Shortened URL (Get):
Request

https://url-shortener-api.onrender.com/api/v1/redirect/{unique-id}

##Ex.
https://url-shortener-api.onrender.com/api/v1/redirect/l2bz27uQfrydC5BiUxyIJ

Response

{
  "status": true,
  "main_link": "https://url-shortener-api.onrender.com/api/v1/redirect/l2bz27uQfrydC5BiUxyIJ",
  
}

url-shortener-nodejs's People

Contributors

sanjeevbrok99 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.