| 1 | /** |
| 2 | * Fly.io Tigris bucket attached to an HTTP Service. |
| 3 | * |
| 4 | * The Service binds Fly.PutObject / Fly.GetObject and talks to Tigris |
| 5 | * over the S3 API. |
| 6 | */ |
| 7 | import * as Alchemy from "alchemy"; |
| 8 | import * as Fly from "alchemy/Fly"; |
| 9 | import * as Effect from "effect/Effect"; |
| 10 | import Api from "./src/api.ts"; |
| 11 | import { Data } from "./src/shared.ts"; |
| 12 | |
| 13 | export default Alchemy.Stack( |
| 14 | "FlyBucket", |
| 15 | { |
| 16 | providers: Fly.providers(), |
| 17 | state: Alchemy.localState(), |
| 18 | }, |
| 19 | Effect.gen(function* () { |
| 20 | const bucket = yield* Data; |
| 21 | const api = yield* Api; |
| 22 | |
| 23 | return { |
| 24 | appName: api.appName, |
| 25 | bucketName: bucket.name, |
| 26 | addOnId: bucket.addOnId, |
| 27 | apiUrl: api.url, |
| 28 | }; |
| 29 | }), |
| 30 | ); |