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]>
1 file changed · +7 −0
src/c21_app.ts
+7
−0
| @@ -346,6 +346,13 @@ ${url("https://tdd.md/leaderboard", "0.7")} | ||
| 346 | 346 | }, |
| 347 | 347 | }), |
| 348 | 348 | |
| 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 | + | |
| 349 | 356 | "/games": htmlResponse(GAMES_INDEX_HTML), |
| 350 | 357 | |
| 351 | 358 | "/blog": async () => { |