| 1 | import * as Neon from "alchemy/Neon"; |
| 2 | import * as Config from "effect/Config"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import { resources } from "../resources.ts"; |
| 5 | import LayerApiLive, { LayerApi } from "./LayerApi.ts"; |
| 6 | |
| 7 | export const forms = Effect.gen(function* () { |
| 8 | const { branch } = yield* resources; |
| 9 | const native = yield* Neon.Function("NativeSql", { |
| 10 | branch, |
| 11 | main: "./src/forms/native.ts", |
| 12 | env: { APP_TOKEN: yield* Config.Redacted("APP_TOKEN") }, |
| 13 | }); |
| 14 | const bare = yield* Neon.Function("Bare", { |
| 15 | branch, |
| 16 | main: "./src/forms/bare.ts", |
| 17 | }); |
| 18 | const hono = yield* Neon.Function("Hono", { |
| 19 | branch, |
| 20 | main: "./src/forms/hono.ts", |
| 21 | }); |
| 22 | const layer = yield* LayerApi.pipe(Effect.provide(LayerApiLive)); |
| 23 | return { |
| 24 | nativeUrl: native.url, |
| 25 | bareUrl: bare.url, |
| 26 | honoUrl: hono.url, |
| 27 | layerUrl: layer.url, |
| 28 | }; |
| 29 | }); |