| 1 | /** |
| 2 | * Fly.io Upstash Redis attached to an HTTP Service. |
| 3 | * |
| 4 | * Redis is not reachable from CI — the Service PING's it over 6PN |
| 5 | * and exposes `{ pong: true }` at `/`. |
| 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 { Cache } from "./src/shared.ts"; |
| 12 | |
| 13 | export default Alchemy.Stack( |
| 14 | "FlyRedis", |
| 15 | { |
| 16 | providers: Fly.providers(), |
| 17 | state: Alchemy.localState(), |
| 18 | }, |
| 19 | Effect.gen(function* () { |
| 20 | const cache = yield* Cache; |
| 21 | const api = yield* Api; |
| 22 | |
| 23 | return { |
| 24 | appName: api.appName, |
| 25 | redisId: cache.redisId, |
| 26 | redisName: cache.name, |
| 27 | apiUrl: api.url, |
| 28 | }; |
| 29 | }), |
| 30 | ); |