Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Latest commit

 

History

History
22 lines (14 loc) · 463 Bytes

README.md

File metadata and controls

22 lines (14 loc) · 463 Bytes

bash-url-shortener

Why not use bash?

Depends

bash, socat, tr, sed, awk, lockfile, rev

Run

To run this you need to install socat. Then:

socat TCP4-LISTEN:8080,fork EXEC:"bash ./server"

Add url

To add url you need to pass json like that:

curl -H "Content-Type: application/json" -X POST -d '{"url":"http://google.com"}' server:port

The output will be

{"url":"://server:port/code"}

Use redirecting

Just open url in your browser