A Minimal, Filesystem-Backed URL Shortener
Examples:
1. Create a short link to https://duckduckgo.com
$ curl -d https://duckduckgo.com short.swurl.xyz
short.swurl.xyz/502fb5543c36014f
2. Create a short link with a custom path
$ curl -d https://duckduckgo.com short.swurl.xyz/ddg
short.swurl.xyz/ddg
3. Create a short link to https://duckduckgo.com using a query string
$ curl short.swurl.xyz?https://duckduckgo.com
short.swurl.xyz/1acd382417199d7e
4. Create a short link with a custom path using a query string
$ curl short.swurl.xyz/ddg?https://duckduckgo.com
short.swurl.xyz/ddg
5. Deleting a short link
$ TMP=$(mktemp)
$ LINK=$(curl -sS short.swurl.xyz -d https://duckduckgo.com -D $TMP)
$ # Link created, headers stored in temp file
$ DEL=$(cat $TMP | grep -i delete-with | awk '{print$2}'| tr -d '\r')
$ # Gets the deletion key, in the 'X-Delete-With' header
$ curl $LINK
<a href="https://duckduckgo.com">Permanent Redirect</a>.
$ curl $LINK -X DELETE -d $DEL
$ curl $LINK
this short link does not exist
$ # Link has been deleted