Skip to content

A url-shortener written in go, backed by redis and hashids

License

Notifications You must be signed in to change notification settings

valerio/shortener

Repository files navigation

Shortener

A simple url-shortener service, backed by redis and using hashIDs for shortening.

It is not meant for production use, but more as an example on how to implement a url-shortener.

Building

Make sure you have dep installed and run:

> dep ensure

Fill in the configuration file (config.json) and simply build the docker image.

Default configuration is setup to be used locally with docker-compose, simply run:

> docker-compose up

API

The shortener offers a simple API:

  • GET /urls/{key}: returns the full url stored with the key provided
  • POST /urls: shortens a new url, json body:
    {
        "url": "http://www.example.com"
    }
  • GET /{key}: redirects to the full url for the specified key

License

See the license file for license rights and limitations (MIT).

About

A url-shortener written in go, backed by redis and hashids

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages