| 1 | --- |
| 2 | import { env } from "cloudflare:workers"; |
| 3 | |
| 4 | // On-demand SSR (the default under `output: "server"` from the fixture's |
| 5 | // real astro.config.mjs): renders inside workerd (dev) / the Worker (live), |
| 6 | // reads a Text binding server-side, and shows the middleware-stamped |
| 7 | // per-request id — different on every request. |
| 8 | const value = (env as Record<string, unknown>).FIXTURE_VALUE ?? null; |
| 9 | const requestId = Astro.locals.requestId ?? "missing"; |
| 10 | --- |
| 11 | |
| 12 | <html lang="en"> |
| 13 | <head> |
| 14 | <meta charset="utf-8" /> |
| 15 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 16 | <title>Astro SSR Fixture</title> |
| 17 | <style> |
| 18 | body { |
| 19 | font-family: system-ui, sans-serif; |
| 20 | margin: 2rem; |
| 21 | color: #1a1a1a; |
| 22 | background: #ffffff; |
| 23 | } |
| 24 | </style> |
| 25 | </head> |
| 26 | <body> |
| 27 | <h1>Astro SSR Fixture</h1> |
| 28 | <p id="mode">on-demand</p> |
| 29 | <p id="binding">{value}</p> |
| 30 | <p id="request-id">{requestId}</p> |
| 31 | <p><a href="/greet/astro">greet</a> · <a href="/feedback">feedback</a> · <a href="/about/">about</a></p> |
| 32 | </body> |
| 33 | </html> |