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.
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 aHEAD
request, replying with an200 OK
status code.code
must not already be taken. If omitted, one will be generated.code
length must not be longer than the compiledMAX_CODE_LENGTH
.ttl
must be within the compiledMIN_TTL
andMAX_TTL
. If omitted, a default will be provided.
{
"target": "https://github.com/z64/hURL",
"code": "hurl",
"ttl": 120
}
The redirect will live at localhost:7777/hurl
until it expires.
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 = Hurl::Client.new("http://hrl.zsixtyfour.com")
client.create("https://github.com/z64/hURL", code: "hurl")
#=> Link
link = client.get("hurl")
#=> Link
- z64 Zac Nowicki - creator, maintainer