shawty

command module
v0.0.0-...-280c745 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2016 License: MIT Imports: 8 Imported by: 0

README

GoDoc license

Shawty: URL Shortener

This service encodes URLs using Hashids

It has 3 features:

Encode
curl -XPOST localhost:8080/encode --data "url=http://dillbuck.com"

>>> pnel5aK

NOTE: url must include the full url, http://etc...

Decode
curl localhost:8080/decode/pnel5aK

>>> http://dillbuck.com

Redirect
curl localhost:8080/pnel5aK

>>>  301 -> http://dillbuck.com

Getting started

Docker

docker run -v <host path>:/data -e "SHAWTY_STORAGE_PATH=/data" -e "SHAWTY_HASH_SALT=<salt>" -d -p 8080:8080 gimanzo/shawty

Old School way:

go get github.com/gimanzo/shawty

export SHAWTY_STORAGE_PATH=<your local storage path>
export SHAWTY_SALT=<your salt>
//optional
export GOOGLE_TRACKER_ID=<your google analytics trackingid>

go build
./shawty
Building the docker file
docker build -t gimanzo/shawty .
Can I use it in production?

You need to implement a storage that can scale beyond one application server.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package storages allows multiple implementation on how to store short URLs.
Package storages allows multiple implementation on how to store short URLs.

Jump to

Keyboard shortcuts

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