The redirect endpoint is the highest-traffic path in Quikko. It resolves short codes from Redis (cache hit) or MongoDB (cache miss), responds with HTTP 302 immediately, and records click analytics asynchronously — keeping redirect latency minimal. No authentication is required; this is a fully public endpoint.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Andr21Da16/Quikko/llms.txt
Use this file to discover all available pages before exploring further.
GET /
GET/{code}
Resolves a Quikko short code and redirects the caller to the original destination URL. This route is mounted at the root of the server — not under /api/v1 — so short URLs are as compact as https://your-domain.com/xYz12A.
Because Echo’s router prioritizes static path segments, routes like
/api/v1/..., /health, and /docs take precedence and never collide with the /:code catch-all parameter.Path parameters
The short code to resolve. For example,
xYz12A or a custom alias like launch-2025.Resolution order
- Redis cache lookup — the short code is looked up in Redis for a sub-millisecond response.
- MongoDB fallback — on a cache miss, the URL record is fetched from MongoDB and the result is written back to Redis for future requests.
- HTTP 302 redirect — the server responds immediately with a
Locationheader pointing to the original URL. - Async click recording — after the response is sent, Quikko fires a goroutine to:
- Resolve the visitor’s country via GeoIP (with a Redis-backed result cache to avoid redundant lookups)
- Record the click event in InfluxDB (used by the Analytics API)
- Broadcast a real-time
click_eventmessage to any WebSocket subscribers watching this short code - Increment the fast
totalClickscounter on the URL document in MongoDB
Response codes
| HTTP | Condition | Location header |
|---|---|---|
| 302 | Short code resolved successfully | The original destination URL |
| 302 | Short code not found (URL_NOT_FOUND) | {FRONTEND_URL}/link-no-encontrado |
| 302 | URL is deactivated (URL_INACTIVE) | {FRONTEND_URL}/link-inactivo |
| 429 | Rate limit exceeded | — (JSON error envelope) |
Unlike the REST API,
GET /{code} is the only endpoint a human opens directly in their browser. For that reason, both URL_NOT_FOUND and URL_INACTIVE error conditions respond with an HTTP 302 redirect to branded frontend error pages instead of returning a raw JSON error envelope. Only genuine 5xx server errors return the standard JSON envelope for diagnostic purposes.Rate limiting
Requests are rate-limited per IP using a 1-second window. The limit is configurable via theRATE_LIMIT_REDIRECT_PER_SEC environment variable (default: 100 requests/second).
curl example
Async analytics and click counts: The
totalClicks field on a URL (returned by the URLs API) is a fire-and-forget counter incremented after the redirect is served. It may lag slightly under high concurrency. For precise, time-series click data — including breakdown by country, device, and browser — use the Analytics API.