hurl
Version, currently master branch1 version
- master branchlatestAug 23, 2017
github.com/z64/hURL
a link shortener
Installation
# Add this to your shard.yml
dependencies:
hurl:
github: z64/hURL
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.23.1- License
- MIT
- Author
- Zac Nowicki
- Target
hurlfrom src/hurl.cr
Dependencies
Runtime Dependencies
README
hURL
It's a link shortener thing.
Deployment
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.
API
POST / - Create a redirect
Returns the created redirect object.
JSON Body
| key | type | required |
|---|---|---|
| target | URI string | yes |
| code | string | no |
| ttl | integer | no |
targetmust be HTTPS scheme and the host must respond to aHEADrequest, replying with an200 OKstatus code.codemust not already be taken. If omitted, one will be generated.codelength must not be longer than the compiledMAX_CODE_LENGTH.ttlmust be within the compiledMIN_TTLandMAX_TTL. If omitted, a default will be provided.
JSON Body Example
{
"target": "https://github.com/z64/hURL",
"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.
Client
An (extremely simple) client is provided too for your crystal apps to talk to a hURL service.
Usage
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
Contributors
- z64 Zac Nowicki - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Aug 23, 2017
- Crystal
0.23.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/z64/hURL
Metadata
- Created
- Sep 7, 2026
- Updated
- Sep 26, 2026
- Synced
- Sep 26, 2026
- Versions
- 1