Candidate ID: Naukri1125
This app implements a URL shortener matching the TinyLink spec.
(put your Vercel/Render URL here)
- GET / -> Dashboard (UI)
- GET /code/:code -> Stats page
- GET /:code -> Redirect (302) or 404
- GET /healthz -> { ok: true, version: "1.0" }
API:
- POST /api/links -> Create link (409 if code exists)
- GET /api/links -> List all links
- GET /api/links/:code -> Stats for one code
- DELETE /api/links/:code -> Delete
Run migration:
npm run migrate
Requires DATABASE_URL env var.
cp .env.example .envand setDATABASE_URLandNEXT_PUBLIC_BASE_URL.npm installnpm run migratenpm run dev