t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/Fly/fixtures/unhealthy-api.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

42 lines
1.1 KiB
TypeScript

import * as Fly from "@/Fly";
import * as Effect from "effect/Effect";
import * as HttpServerResponse from "effect/http/HttpServerResponse";
import { API_PORT } from "./shared.ts";
export const UnhealthySite = Fly.App("UnhealthySite");
export default class UnhealthyApi extends Fly.Service<UnhealthyApi>()(
"UnhealthyApi",
{
app: UnhealthySite,
main: import.meta.url,
region: "iad",
port: API_PORT,
count: 2,
services: [
{
protocol: "tcp",
internalPort: API_PORT,
autostart: true,
autostop: "off",
ports: [{ port: 80, handlers: ["http"] }],
checks: [
{
type: "http",
port: API_PORT,
path: "/health",
interval: "5s",
timeout: "2s",
gracePeriod: "1s",
},
],
},
],
},
Effect.gen(function* () {
yield* Fly.MountVolume({ path: "/data", sizeGb: 1 });
return {
fetch: Effect.succeed(HttpServerResponse.empty({ status: 503 })),
};
}).pipe(Effect.provide(Fly.MountVolumeLive)),
) {}