nxtgauge-gitops/apps/nxtgauge-frontend-solid/base/ingress.yaml
Ashwin Kumar Sivakumar 5e14343e65
All checks were successful
sync-to-forgejo / sync (push) Successful in 20s
fix(ingress): route test111 /api/* to Rust gateway so signup works
The SolidStart frontend (Vinxi 0.5.7) does not mount src/routes/api/* as
Nitro handlers in the production build. With only a single path rule
pointing to the frontend pod, every /api/* call fell through to
SolidStart's Not Found handler and returned the HTML shell page — making
the Sign Up button appear to do nothing.

Added an /api prefix rule before / so Traefik matches the longer
prefix and forwards signup/login/KB requests directly to the
nxtgauge-rust-gateway service on port 9100 (same backend that
api.nxtgauge.com already uses).

Verified:
- POST /api/auth/check-email -> 200 application/json
- POST /api/auth/register   -> 201 application/json
- GET  /                    -> 200 text/html (frontend shell)
- GET  /api/kb/categories   -> 200 application/json
2026-07-04 15:28:50 +05:30

36 lines
1.1 KiB
YAML

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nxtgauge-frontend-solid
namespace: nxtgauge
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
spec:
ingressClassName: traefik
tls:
- hosts:
- test111.nxtgauge.com
secretName: test111-tls
rules:
- host: test111.nxtgauge.com
http:
paths:
# /api/* routes to Rust gateway directly (signup, login, KB, etc.)
# so the SolidStart frontend (which has no /api/auth/* handler due to
# the Vinxi 0.5.7 file-based-route bug) does not have to proxy itself.
# More specific paths must come first — Traefik matches the longest prefix.
- path: /api
pathType: Prefix
backend:
service:
name: nxtgauge-rust-gateway
port:
number: 9100
- path: /
pathType: Prefix
backend:
service:
name: nxtgauge-frontend-solid
port:
number: 80