Skip to content

Commit 60ebac7

Browse files
committed
chore: update API docs
1 parent a066b5e commit 60ebac7

File tree

3 files changed

+18
-24
lines changed

3 files changed

+18
-24
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
[![Docker Stars](https://img.shields.io/docker/stars/sjdonado/bit.svg)](https://hub.docker.com/r/sjdonado/bit)
33
[![Docker Image Size](https://img.shields.io/docker/image-size/sjdonado/bit/latest)](https://hub.docker.com/r/sjdonado/bit)
44

5-
# Bit URL Shortener
6-
75
Lightweight URL shortener service with minimal resource requirements. Average memory consumption is **20MB RAM** with container disk space under **50MB**.
86

97
Bit is highly performant, achieving over 1.8K requests per second with an average latency of 68ms. For detailed benchmark results, see [benchmark](docs/SETUP.md#benchmark).
108

119
Images available on [Docker Hub](https://hub.docker.com/r/sjdonado/bit/tags).
1210

13-
## Quick Start
14-
```bash
15-
docker run -p 4000:4000 -e ADMIN_API_KEY=$(openssl rand -base64 32) sjdonado/bit:latest
16-
```
11+
## Why Bit?
12+
It is feature-complete by design. Its strength lies in simplicity, a reliable URL shortener without unnecessary bloat. Bug fixes will continue, but new features aren't planned.
13+
14+
- Minimal tracking setup: Country, browser, os, referer. No cookies or persistent tracking mechanisms are used beyond what's available from a basic client's request.
15+
- Flexible request forwarding system passes client context (IP, user-agent) to destinations via standard X-Forwarded-For and X-Forwarded-User-Agent headers, enabling advanced tracking and integration capabilities when needed.
16+
- Multiple users are supported via API key authentication. Create, list and delete via the [CLI](docs/SETUP.md#cli).
1717

1818
## Minimum Requirements
1919
- 50MB disk space

app/controllers/ping.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require "../lib/controller.cr"
33
module App::Controllers::Ping
44
class Get < App::Lib::BaseController
55
def call(env)
6-
response = {"pong" => "ok"}
6+
response = {"data" => "pong"}
77
response.to_json
88
end
99
end

docs/API.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
- Response Example
88
```json
99
{
10-
"message": "pong"
10+
"data": "pong"
1111
}
1212
```
1313

1414
2. **Redirect by Slug**
1515

1616
- Endpoint: `GET /:slug`
1717
- Payload: None
18-
- Response 301
18+
- Response: 301
1919

2020
3. **List All Links**
2121

@@ -34,10 +34,10 @@
3434
{
3535
"id": "730e2202-58f9-478c-a24c-f1c561df6716",
3636
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:127.0) Gecko/20100101 Firefox/127.0",
37-
"language": "en-US",
37+
"country": "DE",
3838
"browser": "Firefox",
3939
"os": "Mac OS X",
40-
"source": "Unknown",
40+
"referer": "Direct",
4141
"created_at": "2024-07-12T19:25:22Z"
4242
}
4343
]
@@ -62,10 +62,10 @@
6262
{
6363
"id": "730e2202-58f9-478c-a24c-f1c561df6716",
6464
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:127.0) Gecko/20100101 Firefox/127.0",
65-
"language": "en-US",
65+
"country": "DE",
6666
"browser": "Firefox",
6767
"os": "Mac OS X",
68-
"source": "Unknown",
68+
"referer": "Direct",
6969
"created_at": "2024-07-12T19:25:22Z"
7070
}
7171
]
@@ -89,7 +89,7 @@
8989
"data": {
9090
"id": "84f0c7a4-8c4e-4665-b676-cb9c5e40f1db",
9191
"refer": "http://localhost:4000/3wP4BQ",
92-
"origin": "https://monocuco.donado.co/test",
92+
"origin": "https://example.com",
9393
"clicks": []
9494
}
9595
}
@@ -119,13 +119,7 @@
119119

120120
7. **Delete a link by ID**
121121

122-
- Endpoint: `DELETE /api/links/:id`
123-
- Payload: None
124-
- Headers: `X-Api-Key`
125-
- Response Example:
126-
```json
127-
{
128-
"message": "Link deleted"
129-
}
130-
```
131-
122+
- Endpoint: `DELETE /api/links/:id`
123+
- Payload: None
124+
- Headers: `X-Api-Key`
125+
- Response: 204

0 commit comments

Comments
 (0)