Next.js Backend for Frontend
Installation
SKILL.md
Next.js Backend for Frontend
Expert guidance on using Next.js as a backend — Route Handlers, Proxy, content negotiation, webhooks, proxying to backends, and security best practices.
@doc-version: 16.2.6
Core Concepts
Next.js รองรับ "Backend for Frontend" pattern — สร้าง public endpoints ที่:
- รับ HTTP requests ทุกประเภท
- Return content type ใดก็ได้ (ไม่ใช่แค่ HTML)
- เข้าถึง data sources และทำ side effects
ใช้ผ่าน:
- Route Handlers (
route.ts) — API endpoints - Proxy (
proxy.ts) — request interception - Rewrites (
next.config.js) — URL mapping