839 B
839 B
F-158 — Diseño
Decisión
Separar explícitamente URL pública y URL privada:
- Navegador POS: siempre usa
/apidel mismo origen (:3006). - Route handler Next.js: usa
POS_BACKEND_URL, server-only, con fallbackhttp://127.0.0.1:3000. - No exponer ni incrustar
NEXT_PUBLIC_API_URLen el bundle.
Proxy
- Construye destino desde el catch-all path y query string.
- Reenvía Cookie, Content-Type y
x-terminal-id. - Propaga status, Content-Type y todos los
Set-Cookiedel backend. - GET y POST cubren las operaciones actuales del cliente POS.
Desarrollo LAN
allowedDevOrigins incluye 192.168.18.93 y localhost para recursos Next/HMR.
Seguridad
La URL backend queda server-only. Los paths proceden del segmento catch-all y se concatenan contra una base fija, sin aceptar host suministrado por el cliente.