fix: don't load banner locally

This commit is contained in:
dvelo 2025-05-04 23:35:40 -05:00
parent 7497ca7df1
commit b35f04020d
2 changed files with 4 additions and 16 deletions

@ -35,14 +35,6 @@ export async function GET(
{ params }: { params: Promise<{ id: string }> }
) {
try {
// Load banner image from filesystem
const bannerPath = path.join(
process.cwd(),
"public",
"branding",
"bg-banner.png"
);
const bannerImageData = fs.readFileSync(bannerPath);
const id = (await params).id;
@ -68,7 +60,7 @@ export async function GET(
textAlign: "center",
justifyContent: "center",
alignItems: "center",
backgroundImage: `url(data:image/png;base64,${bannerImageData.toString("base64")})`,
backgroundImage: `url(${new URL("/branding/bg-banner.png", request.url).toString()})`,
backgroundSize: "cover",
backgroundPosition: "center",
fontFamily: "Inter",
@ -256,7 +248,7 @@ export async function GET(
position: "relative",
overflow: "hidden",
fontFamily: "Inter",
backgroundImage: `url(data:image/png;base64,${bannerImageData.toString("base64")})`,
backgroundImage: `url(${new URL("/branding/bg-banner.png", request.url).toString()})`,
backgroundSize: "cover",
backgroundPosition: "center",
}}

@ -128,10 +128,6 @@ export async function GET(
{ params }: { params: Promise<{ id: string }> }
) {
try {
// Load banner image
const bannerImageData = await fetch(
new URL("/branding/bg-banner.png", request.url)
).then((res) => res.arrayBuffer());
const id = (await params).id;
@ -158,7 +154,7 @@ export async function GET(
textAlign: "center",
justifyContent: "center",
alignItems: "center",
backgroundImage: `url(data:image/png;base64,${Buffer.from(bannerImageData).toString("base64")})`,
backgroundImage: `url(${new URL("/branding/bg-banner.png", request.url).toString()})`,
backgroundSize: "cover",
backgroundPosition: "center",
fontFamily: "Inter",
@ -226,7 +222,7 @@ export async function GET(
position: "relative",
overflow: "hidden",
fontFamily: "Inter",
backgroundImage: `url(data:image/png;base64,${Buffer.from(bannerImageData).toString("base64")})`,
backgroundImage: `url(${new URL("/branding/bg-banner.png", request.url).toString()})`,
backgroundSize: "cover",
backgroundPosition: "center",
}}