Service to shorten the provided url. For now a url mapping is maintained in global object. For future scope url mapping is to be kept in redis.
- git clone "repo_url"
- cd url-shortner
- npm install
- node app.js
-
Service to shorten the url
curl -X POST \ http://localhost:3000/shorten-url \ -H 'Content-Type: application/json' \ -H 'Postman-Token: 824af09b-f1a4-4c31-a83e-bf4892a830de' \ -H 'cache-control: no-cache' \ -d '{ "url": "https://zora.medium.com/white-voluntourists-dont-belong-on-indian-reservations-c49027851441" }'
-
Use the response short url in browser.