# ADR 0001 — Comments endpoint lives at /api/posts/[slug]/comments, not /api/comments Date: 2026-10-03 ## Status Accepted ## Context The comments API needs a route. The conventional-looking path `/api/comments` collides with Payload: it auto-mounts REST CRUD for every collection at `/api/`. A `comments` collection therefore already serves `/api/comments` for the admin panel, and moderation (approve/reject) runs through that panel. An app-router route at the same path would shadow and break the panel's CRUD. ## Decision Comments are created at `POST /api/posts/[slug]/comments` (`src/app/api/posts/[slug]/comments/route.ts`), matching the existing `/api/posts/[slug]/like` pattern. Admin moderation keeps using Payload's own REST/admin panel. ## Tests for a real ADR - **Hard to reverse**: the endpoint is a public contract consumed by the client form; moving it breaks every deployed client. - **Surprising**: the collision with Payload's auto-mounted REST is non-obvious — a developer would naturally reach for `/api/comments`. - **Real trade-off**: a shorter conventional path vs. a working admin moderation panel.