Requires Node.js to run.
Install the dependencies and devDependencies and start the server.
cd url-shortner-nodejs
npm install
node src/server.js
curl --location --request POST 'http://localhost:4445/api/links' \
--header 'Content-Type: application/json' \
--data-raw '{
"link": "https://youtube.com"
}'
curl --location --request POST 'http://localhost:4445/api/links' \
--header 'Content-Type: application/json' \
--data-raw '{
"link": "https://youtube.com",
"code": "ytube"
}'
curl --location --request GET 'http://localhost:4445/api/links/G9afhv'
curl --location --request GET 'http://localhost:4445/G9afhv'