1import * as Alchemy from "alchemy";
2import * as Cloudflare from "alchemy/Cloudflare";
3import * as Effect from "effect/Effect";
4
5export default Alchemy.Stack(
6 "CloudflareOctaneExample",
7 {
8 providers: Cloudflare.providers(),
9 state: Cloudflare.state(),
10 },
11 Effect.gen(function* () {
12 // Server routes read the namespace at request time via
13 // `context.platform.env.CACHE` (see octane.config.ts).
14 const cache = yield* Cloudflare.KV.Namespace("Cache");
15
16 const site = yield* Cloudflare.Website.Octane("CloudflareOctane", {
17 env: {
18 CACHE: cache,
19 },
20 });
21
22 return {
23 url: site.url,
24 };
25 }),
26);