1---
2import { env } from "cloudflare:workers";
3// Tailwind is wired through astro.config.ts (@tailwindcss/vite) — Alchemy
4// loads the project's own config natively, so the utilities below compile.
5import "../styles/global.css";
6import Card from "../components/Card.astro";
7
8// Server-rendered on every request inside the Cloudflare Worker.
9// Bindings declared in alchemy.run.ts are available on `env`.
10const greeting = (env as Record<string, unknown>).GREETING ?? "Hello!";
11const now = new Date().toISOString();
12---
13
14<html lang="en">
15 <head>
16 <meta charset="utf-8" />
17 <meta name="viewport" content="width=device-width, initial-scale=1" />
18 <title>Astro on Cloudflare</title>
19 </head>
20 <body class="bg-slate-50 p-8 text-slate-900">
21 <h1 class="text-3xl font-bold">{greeting}</h1>
22 <Card
23 title="Styled with Tailwind CSS"
24 body="This card is an Astro component styled with Tailwind utilities."
25 />
26 <p class="mt-4 text-slate-600">
27 This page is server-rendered in a Cloudflare Worker at {now}.
28 </p>
29 <p class="mt-2">
30 <a href="/about/" class="text-blue-600 underline">A prerendered page</a>
31 </p>
32 </body>
33</html>