| 1 | /** |
| 2 | * A Fly.io Sprite that exercises the Platform class form: |
| 3 | * |
| 4 | * - `Box` — HTTP Sprite (`src/box.ts`) |
| 5 | * |
| 6 | * A Sprite is org-scoped. There is no parent App. Alchemy bundles |
| 7 | * `main` and runs it on the Sprite. Auth is FLY_API_TOKEN. |
| 8 | */ |
| 9 | import * as Alchemy from "alchemy"; |
| 10 | import * as Fly from "alchemy/Fly"; |
| 11 | import * as Effect from "effect/Effect"; |
| 12 | import Box from "./src/box.ts"; |
| 13 | |
| 14 | export default Alchemy.Stack( |
| 15 | "FlySprite", |
| 16 | { |
| 17 | providers: Fly.providers(), |
| 18 | state: Alchemy.localState(), |
| 19 | }, |
| 20 | Effect.gen(function* () { |
| 21 | const box = yield* Box; |
| 22 | |
| 23 | return { |
| 24 | spriteId: box.spriteId, |
| 25 | name: box.name, |
| 26 | url: box.url, |
| 27 | status: box.status, |
| 28 | urlAuth: box.urlAuth, |
| 29 | }; |
| 30 | }), |
| 31 | ); |