- GeradoresService: cada tipo passa a ser um IGenerator (NIF, NIPC, NISS, CC, passaporte, IBAN, NIB, cartões, referência MB, pessoa, telefone, código postal, email, matrícula, EAN, UUID) registado em GeneratorRegistry; remove DAL/EF - GeradoresWS: minimal APIs em /api/v1 com OpenAPI + Scalar e health check - UnitTest: testes de ida e volta, valores conhecidos, detecção e API - geradoresfe: UI construída a partir dos metadados da API, validador livre, exportação CSV/JSON/TXT, nginx com API_UPSTREAM configurável - Docker, docker-compose e Jenkinsfile actualizados Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
server {
|
|
listen 80;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# API no mesmo domínio: sem CORS e sem URL da API embutido no build.
|
|
location ~ ^/(api|docs|openapi)(/|$) {
|
|
proxy_pass ${API_UPSTREAM};
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# Ficheiros com hash no nome: cache longa.
|
|
# (add_header num location anula os do server, por isso os cabeçalhos de segurança repetem-se.)
|
|
location /assets/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
add_header X-Content-Type-Options nosniff;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# SPA fallback
|
|
location / {
|
|
add_header Cache-Control "no-cache";
|
|
add_header X-Content-Type-Options nosniff;
|
|
add_header Referrer-Policy strict-origin-when-cross-origin;
|
|
try_files $uri /index.html;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
|
}
|