Minimal HTTP service that resolves MX records for a domain. Exists as a separate process because the calling server operates under a security policy that prohibits outbound DNS MX queries directly.
curl https://mx-resolver.proconnect.gouv.fr/beta.gouv.fr[{ "exchange": "mx.ox.numerique.gouv.fr", "priority": 1 }]curl https://mx-resolver.proconnect.gouv.fr/alpha.gouv.fr{ "error": "ENODATA alpha.gouv.fr" }GET /:domain
200 — MX records found
[{ "exchange": "mx.ox.numerique.gouv.fr", "priority": 1 }]400 — missing or invalid domain
{ "error": "domain required" }
{ "error": "invalid domain" }404 — no MX records (ENODATA, ENOTFOUND)
{ "error": "ENODATA alpha.gouv.fr" }504 — DNS resolver did not respond within 5 seconds
{ "error": "DNS timeout" }# Default
# PORT=3000
# RESOLVE_TIMEOUT_MS=5000
node --experimental-strip-types main.ts