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

main
ts 20 lines 669 Bytes
Raw
1 import * as AWS from "@alchemy.run/aws";
2 import * as Cloudflare from "@alchemy.run/cloudflare";
3 import { Queues, R2 } from "@alchemy.run/cloudflare";
4 import * as Alchemy from "alchemy";
5 import * as Effect from "effect/Effect";
6 import * as HttpServerResponse from "effect/http/HttpServerResponse";
7
8 // #region show
9 const api = Effect.gen(function* () {
10 const bucket = yield* R2.Bucket("Uploads");
11 const uploads = yield* R2.ReadBucket(bucket);
12 return {
13 fetch: Effect.gen(function* () {
14 const file = yield* uploads.get("hello.txt");
15 return HttpServerResponse.text("ok");
16 }) /*hide*/
17 .pipe(Effect.orDie) /*end*/,
18 };
19 });
20 // #endregion show