Skip to content

AlbinoDrought/creamy-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creamy Shortener

albinodrought/creamy-shortener Docker Pulls AGPL-3.0 License

Barebones link "shortener" using multihashes: identical URLs will always shorten to the same shortened links.

Shortening

curl -X POST -d "link=https://example.com/foo?bar" "https://your.shortener/shorten"

Output:

https://your.shortener/l/Qma3YMYZUNAY7Dp7UhtZfqKAfsLkHyF9jf1yFXjZbYjWqt

Building

Without Docker

go get -d -v
go build

With Docker

docker build -t albinodrought/creamy-shortener .

Running

CREAMY_APP_URL="https://your.shortener/" \
CREAMY_DATA_PATH=/data \
CREAMY_HASH_MODE=sha2-256 \
CREAMY_HTTP_PORT=80 \
CREAMY_POPULATED_HOSTS=localhost,example.com \
./creamy-shortener
  • CREAMY_APP_URL: the externally-accessible URL this instance can be reached at, defaults to http://localhost:3000/

  • CREAMY_DATA_PATH: the path to persist all data, defaults to ./data

  • CREAMY_HASH_MODE: multihash mode to use, defaults to sha2-256

  • CREAMY_HTTP_PORT: port to listen on, defaults to 3000

  • CREAMY_POPULATED_HOSTS: hosts (including port) to allow link shortening for, defaults to localhost

About

Barebones link "shortener" using multihashes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published