@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 26 lines 798 Bytes
Raw
1 import * as Fly from "@alchemy.run/fly";
2 import * as Cause from "effect/Cause";
3 import * as Effect from "effect/Effect";
4 import * as HttpServerResponse from "effect/http/HttpServerResponse";
5 import { Ping, Pong } from "./rpc-cycle.ts";
6
7 export default Ping.make(
8 {
9 main: import.meta.url,
10 region: "iad",
11 guest: { cpuKind: "shared", cpus: 1, memoryMb: 256 },
12 },
13 Effect.gen(function* () {
14 const pong = yield* Fly.bindService(Pong);
15 return {
16 name: () => Effect.succeed("ping"),
17 fetch: Effect.gen(function* () {
18 return HttpServerResponse.text(`ping hears ${yield* pong.name()}`);
19 }).pipe(
20 Effect.catchCause((cause) =>
21 Effect.succeed(HttpServerResponse.text(Cause.pretty(cause), { status: 502 })),
22 ),
23 ),
24 };
25 }),
26 );