Server Routes vs. API Routes: Choosing the Right Approach
Server Routes vs. API Routes: Choosing the Right Approach
Typical architecture
- Nuxt app: Handles UI, SSR, routing, and some light data orchestration.
- Backend API: Exposes REST/GraphQL endpoints, handles business logic, auth, and data persistence.
…
In practice, many real‑world apps use a hybrid approach:
- External API: Core business logic, data models, and long‑lived endpoints.
- Nuxt server routes: BFF layer that adapts the external API to the needs of the Nuxt app.
This gives you the best of both worlds: a reusable backend plus a Nuxt‑specific layer optimized for your UI and SSR.
Source [web-archive]
// Backend‑for‑frontend (BFF)
There’s a wish there was more about the concepts and more strict difference between those stated, but regardless, thank you!
I’ve been into PHP and web-dev for around two decades now…
And with quite much experience, I do the projects, flows and Communities of PHP, Laravel, Symfony, and sure the frequent and brilliant VueJs, InertiaJs, and, Nuxt! ✨