Read in Russian | English
Lightweight URL Shortener REST API built with Hono, Bun, Valibot, and OpenAPI.
- Validation: Runtime schema validation with Valibot.
- OpenAPI / Scalar: Self-documenting API at
/scalar(disabled in production). - Errors: Standardized JSON error format (
{ "error": "..." }). - Tests: Integrated E2E suite via
bun:test.
bun install
bun dev- Server: http://localhost:3000
- Docs: http://localhost:3000/scalar
bun dev— Development server with watch modebun start— Production serverbun test— Run unit & E2E tests
| Method | Endpoint | Description |
|---|---|---|
POST |
/links |
Create a shortened URL |
GET |
/links |
List all shortened URLs |
GET |
/links/:code/stats |
Get link click statistics |
DELETE |
/links/:code |
Delete a shortened link |
GET |
/:code |
Redirect to original URL (302) |
Made with ❤️ by Quarnel