creamy-shortener

command module
v0.0.0-...-8381eac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2019 License: AGPL-3.0 Imports: 13 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL