Skip to content

tajain07/url-shortner-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortner

Steps to start project :

Requires Node.js to run.

Install the dependencies and devDependencies and start the server.

cd url-shortner-nodejs
npm install
node src/server.js

API calls

Create random short url


curl --location --request POST 'http://localhost:4445/api/links' \
--header 'Content-Type: application/json' \
--data-raw '{
   "link": "https://youtube.com"
}'

Create custom short url


curl --location --request POST 'http://localhost:4445/api/links' \
--header 'Content-Type: application/json' \
--data-raw '{
   "link": "https://youtube.com",
   "code": "ytube"
}'

Get original URl from short url

curl --location --request GET 'http://localhost:4445/api/links/G9afhv'

Redirect to original URl from short url

curl --location --request GET 'http://localhost:4445/G9afhv'

About

URL shorter service implemented in Nodejs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors