Next.js Route Handlers as your backend seam

Route Handlers in `app/api/*/route.ts` are a convenient place to call upstream services without exposing API keys to the browser.

Why keep logic on the server

  • Secrets stay in environment variables available to the server runtime only.
  • You can add authentication, rate limiting, and logging in one place.
  • The client stays thin: it sends inputs and renders JSON responses.

Pattern used in this template

The home page calls `GET /api/tool?q=...`. Replace the handler body with your integration, then decide for yourself whether the response should render a list, chart, modal, redirect, or nothing at all.