Updates the packages and the banner live in the browser

The build still bakes the current packages and the active banner into the HTML.
After hydration the page asks /api/v1/offerings and /api/v1/offerings/banner
once and replaces what differs; errors and time-outs keep what was baked, and
a 204 from the banner route hides the banner. The banner is now the
OfferingBanner contract (title, text, optional link) instead of layout=banner.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 11:19:50 +01:00
co-authored by Claude Sonnet 5.5
parent f9180f231f
commit 12319bb841
22 changed files with 584 additions and 180 deletions
+13 -2
View File
@@ -217,6 +217,15 @@ export function contactStubResponse(
captcha: null,
});
}
// Live packages and banner: "no data" (204), so the page stays with the
// baked list and shows no banner, without a 404 in the console (the site
// asks once per page load)
if (
method === 'GET' &&
(path === '/api/v1/offerings' || path === '/api/v1/offerings/banner')
) {
return { status: 204, body: '' };
}
if (method === 'POST' && path === CONTACT_API) {
return json(202, { status: 'received' });
}
@@ -248,10 +257,12 @@ export function startPreviewServer(
response,
stub.status,
{
'Content-Type': 'application/json',
...(stub.body
? { 'Content-Type': 'application/json' }
: {}),
'Cache-Control': 'no-store',
},
stub.body,
stub.body || null,
);
request.resume();
return;