The best way to control Claude Code, Codex and more from any computer or phone

main
ts 32 lines 830 Bytes
Raw
1 import * as Railway from "@alchemy.run/railway";
2 /**
3 * Minimal Railway stack: a Project and an image Service.
4 * The full graph (Postgres, Redis, Bucket, Volume, Variable,
5 * Environment, TcpProxy, Effect Service + bindings) is
6 * `examples/railway-service`.
7 */
8 import * as Alchemy from "alchemy";
9 import * as Effect from "effect/Effect";
10
11 export 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 );