Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/system76/beebee
URL shortener for http://s76.co
https://github.com/system76/beebee
Last synced: 2 months ago
JSON representation
URL shortener for http://s76.co
- Host: GitHub
- URL: https://github.com/system76/beebee
- Owner: system76
- License: mit
- Created: 2016-05-06T15:24:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-01T22:28:29.000Z (10 months ago)
- Last Synced: 2024-03-01T23:32:02.126Z (10 months ago)
- Language: Elixir
- Homepage: https://s76.co
- Size: 40.8 MB
- Stars: 57
- Watchers: 9
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# BeeBee
[![BB-8](http://vignette2.wikia.nocookie.net/starwars/images/6/63/BB-8thumbsup.png/revision/latest/scale-to-width-down/220?cb=20160402062321)](http://starwars.wikia.com/wiki/BB-8)
## Requirements
BeeBee requires Elixir >= 1.10 and Redis >= 3.0.
## Setup
1. run `mix deps.get`
2. run `mix run --no-halt`
3. enjoy!## Usage
BeeBee exposes four API endpoints, `POST /_add`, `PUT /_update`, `DELETE /_delete/:short_tag` and `GET /_stats`.
### `POST /_add`
**Accepts:**
```js
{
"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:**
```js
{
"short_tag": "github" // Short tag now mapped to the provided URL
}
```### `DELETE /_delete/:short_tag`
**Returns:**
status code 204
### `GET /_stats`
**Returns:**
```js
[
{
"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