URL Shortener
Pure Python URL shortener service using asyncio.
Quick Start
Running the Server
Or using Make:
The server starts at http://localhost:8000 by default.
Testing the API
Shorten a URL:
curl -X POST http://localhost:8000/shorten \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/very/long/path"}'
Response:
Redirect to original URL:
Response:
Health check:
Response:
Constraints
- Package Manager:
uvonly - Testing: pytest with coverage
- Server: Pure asyncio (no frameworks)
- Code Quality: Ruff + mypy (strict)
- Python: 3.12+