Add More Features to pages main component

This commit is contained in:
2026-03-17 18:53:27 +01:00
parent 9e94e20198
commit ee1fb5897e
5 changed files with 52 additions and 153 deletions
@@ -36,11 +36,23 @@ async function generateRes({
module,
meta,
head,
routeParams,
});
if (serverRes?.redirect?.destination) {
return Response.redirect(
serverRes.redirect.destination,
serverRes.redirect.permanent
? 301
: serverRes.redirect.status_code || 302,
);
}
const res_opts: ResponseInit = {
...serverRes?.responseOptions,
headers: {
"Content-Type": "text/html",
...serverRes?.responseOptions?.headers,
},
};
@@ -55,5 +67,9 @@ async function generateRes({
const res = new Response(html, res_opts);
if (routeParams?.resTransform) {
return await routeParams.resTransform(res);
}
return res;
}