lecoffre_node/tests/api_routing.md

1.7 KiB
Raw Blame History

Plan de tests — routage API via Nginx

Pré-requis

  • Nginx actif avec conf/nginx/dev4.4nkweb.com.conf chargé.
  • Services: backend (8080), storage (8081), ws relay (8090), blindbit (8000), front (3000/3003).

Vérifications HTTP

  • GET https://dev4.4nkweb.com/back/health → 200
  • (Si alias validé) GET https://dev4.4nkweb.com/api/health → 200
  • GET https://dev4.4nkweb.com/storage/health → 200

Vérifications front

  • Ouvrir https://dev4.4nkweb.com/lecoffre/ → 200, pas derreurs CORS ni ERR_BLOCKED_BY_CLIENT.
  • Ouvrir la console réseau: les appels API doivent cibler /back/... (ou /api/...) sous le même hôte.

Non-régression: absence de localhost:8080 dans les bundles

  • Télécharger la page et scanner les scripts:
    • curl -sS https://dev4.4nkweb.com/lecoffre/ -o /tmp/lecoffre_index.html
    • grep -oP '(?<=<script src=")[^"]+' /tmp/lecoffre_index.html | sed 's#^/#https://dev4.4nkweb.com/#' | while read u; do curl -sS "$u" | grep -q 'localhost:8080' && echo "KO: $u"; done
    • Attendu: aucun KO:

Vérification réécriture sub_filter

  • Contrôler quaucune requête ne vise http://localhost:8080:
    • Recharger avec cache vidé et surveiller longlet Réseau.
    • Télécharger une ressource HTML/JS et vérifier labsence de http://localhost:8080.

Redirections locales

  • curl -I http://local.4nkweb.com:3000/ → 301 Location https://dev4.4nkweb.com/lecoffre/
  • curl -I http://local.4nkweb.com:3000/authorized-client?code=ABC → 301 Location https://dev4.4nkweb.com/lecoffre/authorized-client?code=ABC

WebSocket

  • wss://dev4.4nkweb.com/ws handshake OK (101)

Journaux Nginx

  • error.log: aucun message critique après rechargement.