a link shortener


It's a link shortener thing.


hURL supports deployment with docker and docker-compose.

It should be as simple as cloning this repo and running docker-compose up -d.

This will create containers of a compiled hURL image networked with a Redis instance.

By default, it listens on port 7777. See the docker-compose.yml for more information.


POST / - Create a redirect

Returns the created redirect object.


key type required
target URI string yes
code string no
ttl integer no
  • target must be HTTPS scheme and the host must respond to a HEAD request, replying with an 200 OK status code.
  • code must not already be taken. If omitted, one will be generated.
  • code length must not be longer than the compiled MAX_CODE_LENGTH.
  • ttl must be within the compiled MIN_TTL and MAX_TTL. If omitted, a default will be provided.

JSON Body Example

  "target": "",
  "code": "hurl",
  "ttl": 120

The redirect will live at localhost:7777/hurl until it expires.

GET /{code} - Query redirect

Executes a redirect stored at the given code to its target.

If you provide the header Accept: application/json, you will get the stored object instead of being redirected.

Note: If using Redis, viewing the redirect object counts as a use.


An (extremely simple) client is provided too for your crystal apps to talk to a hURL service.


require "hurl/client"

client ="")

client.create("", code: "hurl")
#=> Link

link = client.get("hurl")
#=> Link


  • z64 Zac Nowicki - creator, maintainer
github statistic
  • 2
  • 0
  • 0
  • 3
  • about 3 years ago
  • August 13, 2017

MIT License

Synced at

Sun, 25 Oct 2020 13:21:13 GMT