syntaxai/tdd.md · commit 7a27e00

Add /og.png route for the new SAMA social preview (#8)

The image file was copied into the container correctly via
public/og.png, but the Bun server only had an explicit /og.svg route
— no static directory handler — so /og.png returned 404 even though
the file existed. Adding a sibling /og.png route makes the new PNG
preview reachable for X, LinkedIn, Slack and friends.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
author
syntaxai <[email protected]>
date
2026-05-22 08:54:34 +01:00
parent
da3039c
commit
7a27e00eb40be0171b5d3fd8618b0d3fffeca552

1 file changed · +7 −0

modified src/c21_app.ts +7 −0
@@ -346,6 +346,13 @@ ${url("https://tdd.md/leaderboard", "0.7")}
346346 },
347347 }),
348348
349+ "/og.png": new Response(Bun.file("./public/og.png"), {
350+ headers: {
351+ "Content-Type": "image/png",
352+ "Cache-Control": "public, max-age=3600",
353+ },
354+ }),
355+
349356 "/games": htmlResponse(GAMES_INDEX_HTML),
350357
351358 "/blog": async () => {