Show click counts for short links
Users want to know whether their short links are being used.
What to build
- Every successful redirect through
GET /{code}increments a click count for that code. GET /api/links/{code}returns the count as a newclicksfield (0 for a new link). Existing fields are unchanged.- Unknown codes keep returning 404 and are not counted.
Acceptance criteria
- Add a test in
tests/test_app.py: create a link, follow it twice, and check thatGET /api/links/{code}reportsclicks == 2. - All existing tests still pass.
- Keep the change small. Only
app/main.pyandtests/test_app.pyshould change. - Open a merge request that says
Closesthis issue.