1/**
2 * Minimal Railway stack: a Project and an image Service.
3 * The full graph (Postgres, Redis, Bucket, Volume, Variable,
4 * Environment, TcpProxy, Effect Service + bindings) is
5 * `examples/railway-service`.
6 */
7import * as Alchemy from "alchemy";
8import * as Railway from "alchemy/Railway";
9import * as Effect from "effect/Effect";
10
11export default Alchemy.Stack(
12 "RailwayProjectExample",
13 {
14 providers: Railway.providers(),
15 state: Alchemy.localState(),
16 },
17 Effect.gen(function* () {
18 const site = yield* Railway.Project("Site");
19 const web = yield* Railway.Service("Web", {
20 project: site,
21 image: "hashicorp/http-echo",
22 port: 5678,
23 });
24
25 return {
26 url: web.url,
27 projectId: site.projectId,
28 projectName: site.name,
29 serviceId: web.serviceId,
30 };
31 }),
32);