domain_health_status

This commit is contained in:
2026-04-28 20:38:50 -05:00
parent f097f96d06
commit 62219a372a
8 changed files with 743 additions and 4 deletions

View File

@@ -102,3 +102,19 @@ export const billingAPI = {
return (await api.get(`/api/billing/events${qs ? '?' + qs : ''}`)).data;
},
};
export const healthAPI = {
// Read the last persisted status (cheap; used by the banner).
// Returns null if the domain has never been checked.
getStatus: async (domain) => {
try {
return (await api.get(`/api/health/domains/${encodeURIComponent(domain)}`)).data;
} catch (err) {
if (err.statusCode === 404) return null;
throw err;
}
},
// Run all checks now and return the full report.
runCheck: async (domain) =>
(await api.post(`/api/health/domains/${encodeURIComponent(domain)}/check`)).data,
};