BeeBee requires Elixir >= 1.10 and Redis >= 3.0.
- run
mix deps.get
- run
mix run --no-halt
- enjoy!
BeeBee exposes four API endpoints, POST /_add
, PUT /_update
, DELETE /_delete/:short_tag
and GET /_stats
.
Accepts:
{
"url": "https://github.com", // URL to be shortened
"short_tag": "github" // OPTIONAL short tag
}
If a short tag is omitted, one will be randomly generated for you.
Returns:
{
"short_tag": "github" // Short tag now mapped to the provided URL
}
Returns:
status code 204
Returns:
[
{
"short_tag": "github",
"url": "https://github.com",
"count": 0
},
// ...
]
Any other route will try and find a matching short tag, increment the count, and return a 301 to the provided URL.
A 404 with an empty body will be returned for missing short tags