This is a URL shortener API that can be used to short a URL. IT is build in NODE JS
- npm init (to initalize npm)
- npm install express mongoose shortid (these are some packages used in project)
- node index.js
1.Mogodb installed 2.Mongod should be running
Test with postman Api
- METHOD to post
- http:localhost:5000/api/url/shortner (this should be added int the url field )
- In body ADD { "longUrl": "your long url should be here"}
- Add Header where key is CONTENT-TYPE and Value is application/json
- click on send , you will see the JSON object as response where KEY shortUrl contains the short url