The best way to control Claude Code, Codex and more from any computer or phone

main
ts 48 lines 1.06 KB
Raw
1 import * as Cloudflare from "@alchemy.run/cloudflare";
2 import * as Alchemy from "alchemy";
3 import * as Effect from "effect/Effect";
4 import Backend from "./src/Backend.ts";
5 import { KV, DB } from "./src/Bindings";
6
7 /** Do not bind `VINEXT_KV_CACHE` — Website.Vinext provisions it. */
8 export class Vinext extends Cloudflare.Website.Vinext<Vinext>()("Vinext", {
9 memo: {
10 lockfile: true,
11 include: [
12 "app/**",
13 "public/**",
14 "worker/**",
15 "src/**",
16 "migrations/**",
17 "proxy.ts",
18 "package.json",
19 "vite.config.ts",
20 "tsconfig.json",
21 ],
22 },
23 env: {
24 GREETING: "Hello from vinext on Cloudflare!",
25 BACKEND: Backend,
26 KV,
27 DB,
28 },
29 }) {}
30
31 export type VinextEnv = Cloudflare.InferEnv<typeof Vinext>;
32
33 export default Alchemy.Stack(
34 "CloudflareWebsiteVinextExample",
35 {
36 providers: Cloudflare.providers(),
37 state: Cloudflare.state(),
38 },
39 Effect.gen(function* () {
40 const backend = yield* Backend;
41 const site = yield* Vinext;
42
43 return {
44 url: site.url,
45 apiUrl: backend.url,
46 };
47 }),
48 );