%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR subgraph Era1["ยุค Native HTTP / Low-level Server"] A["http.createServerเขียน routing เอง"] end subgraph Era2["ยุค Express / Minimal Framework"] B["app.get/app.postRouting ง่าย"] C["Middlewareงานกลาง request"] end subgraph Era3["ยุค Modular API / Scalable Express"] D["express.Routerแยก route เป็นไฟล์"] E["Error Middlewareจัดการ error กลาง"] end A --> B --> C --> D --> E
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR A["Client Requestคำขอ"] --> B["Middlewareตรวจ/แปลงข้อมูล"] B --> C["Routerเลือก endpoint"] C --> D["Route Handlerทำงานหลัก"] D --> E["Responseส่งผลลัพธ์"] D --> F["Error Handlerจัดการข้อผิดพลาด"] F --> E