QuizNot attempted
Server Action or Route Handler?
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- A Route Handler (
app/api/orders/route.ts)
- An external client like a mobile app needs a real HTTP endpoint with a stable URL, methods, status codes and headers, which is what a Route Handler (
app/api/orders/route.ts) is. - Not a Server Action: its endpoint id is generated per build and meant to be called by your own React UI.
- Not a Server Component: it renders UI, it can't accept a POST.
- Not a Client Component with fetch: that is a caller, it still needs an endpoint to call.