A simple URL shortener written in Go programming language.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2ac5ff7 Feb 26, 2015
Permalink
Failed to load latest commit information.
shortener Fixing test Feb 26, 2015
.gitignore Initial Commit Feb 13, 2015
LICENSE Fix license Feb 17, 2015
README.md Fix typos Feb 21, 2015
main.go Update main.go Feb 26, 2015

README.md

Gohort

Gohort is a simple URL shortener written in Go.

Its design is based out the Stack Overflow question about writing a URL shortner. It uses gorilla/mux for routing requests.

It provides a RESTful API to create and retrive short URL and their corresponding expanded forms.

Running Gohort

Gohort requires a working Redis installation.

Once you have a working Redis installation, go get the project from Github.

go get github.com/aishraj/gohort

Now change into the project directory and run go build

Next run the executable connecting to a local Redis installation:

./gohort -cpus=1 -rhost="localhost" -rport=6379 -sport=8090 -timeout=10

Example

In order to create a new short URL:

curl -X POST http://localhost:8080/api/v1/?base=www.google.com

In order to retrive the original URL from the shortend URL:

curl http://localhost:8080/api/v1/?alias=8CQ