Base URL
- Local (Express on port 4000):
http://localhost:4000β API routes are under/api/...(e.g.http://localhost:4000/api/reports). - Production (Vercel, same host as the site):
https://your-deployment.vercel.appβ use/api/...on that same origin (do not setNEXT_PUBLIC_API_URLso the web app uses relative URLs).
This document uses path suffixes like /reports; the full path is /api/reports (Express mounts routers under /api).
List all reports.
Response:
{ "reports": [ { "id": "...", "latitude": 45.46, "longitude": 9.19, "status": "reported", ... } ] }Get a single report.
Create a new report. multipart/form-data.
| Field | Type | Required | Notes |
|---|---|---|---|
| photos | File[] | β | up to 5 image files |
| latitude | number | β | |
| longitude | number | β | |
| severity | string | β | small / medium / large |
| description | string | β | |
| tags | JSON array | β | e.g. ["Plastic","Hazardous"] |
| anonymous | boolean | β |
Update status (admin/moderator). JSON body: { "status": "verified" }.
Statuses: reported | verified | cleaning | cleaned | rejected