1import * as Fly from "alchemy/Fly";
2import * as Redacted from "effect/Redacted";
3
4export const VOLUME_PATH = "/data";
5export const MARKER_FILE = `${VOLUME_PATH}/hello.txt`;
6export const MARKER = "hello-from-fly-worker";
7export const API_PORT = 3000;
8export const SECRET_NAME = "FLY_EXAMPLE_MARKER";
9
10/**
11 * Parent App both Services share. Each Service is its own Machine
12 * (not systemd-on-a-box). Name is generated; `enableSubdomains` is
13 * create-only.
14 */
15export const Site = Fly.App("Site", {
16 enableSubdomains: true,
17});
18
19/**
20 * App secret {@link Api} reads via {@link Fly.GetSecret}. Fly also
21 * injects it into Machines as an env var named {@link SECRET_NAME}.
22 */
23export const Marker = Fly.Secret("Marker", {
24 app: Site,
25 name: SECRET_NAME,
26 value: Redacted.make(MARKER),
27});
28
29/**
30 * Shared IPv4 so `{app}.fly.dev` answers. Dedicated IPv4 is billed.
31 */
32export const PublicIp = Fly.IpAssignment("Shared", {
33 app: Site,
34 type: "shared_v4",
35});