Files
EpicNext-Cms/scripts/verify-runtime-metadata.mjs
T
Simo c389c3893d
CI / check (push) Successful in 52s
CI / deploy (push) Successful in 2m10s
CI / publish-container (push) Failing after 1m18s
feat(cms): improve catalog, editorial recovery and operations
2026-09-09 19:36:15 +02:00

20 lines
813 B
JavaScript

// Metadata handlers can resolve runtime settings without a working application DB.
export async function verifyRuntimeMetadata(base, hotel) {
const manifest = await fetch(`${base}/manifest.webmanifest`, {
signal: AbortSignal.timeout(15000),
});
if (!manifest.ok)
throw new Error(`${hotel}: manifest HTTP ${manifest.status}`);
if ((await manifest.json()).name !== `Fixture ${hotel}`)
throw new Error(`${hotel}: manifest contains build-time settings`);
for (const path of ["/robots.txt", "/sitemap.xml"]) {
const response = await fetch(base + path, {
signal: AbortSignal.timeout(15000),
});
if (!response.ok)
throw new Error(`${hotel}: ${path} HTTP ${response.status}`);
if (!(await response.text()).includes(base))
throw new Error(`${hotel}: ${path} contains build-time domain`);
}
}