Next.js Custom Server
Installation
SKILL.md
Next.js Custom Server
Expert guidance on setting up a custom Next.js server for programmatic control — when to use, configuration options, and integration with existing backends.
@doc-version: 16.2.6
Core Concepts
Custom server ให้คุณ start Next.js programmatically สำหรับ custom patterns ที่ built-in router ไม่รองรับ
ส่วนใหญ่ไม่จำเป็นต้องใช้ — ใช้เมื่อ integrated router ไม่ตอบโจทย์เท่านั้น
Trade-offs:
- ❌ สูญเสีย Automatic Static Optimization
- ❌ ใช้ร่วมกับ
output: 'standalone'ไม่ได้ - ❌ ไม่ผ่าน Next.js Compiler/bundling