def serve_step
near-v-framework@0.4.0.0 · domain/architecture/system/deployment/nix_darwin/effects.bend:188
import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend as Effects
import Base
import bend-net-json@0.3.0.0/json.bend as Json
import near-v-framework@0.4.0.0/domain/architecture/system/plan/type.bend as P
import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/type.bend as ND
188
189def serve_step(s: ND.Serve, +web: Json.Val, +ours: List<&2, String>, +tailscale: String, +what: String) -> P.Step:
190 match s:
191 case ND.Serve{_, +h, p, path}:
192 +target = "http://127.0.0.1:" ++ U32.show(p) ++ path
193 +now = proxy_on(web, keys(web), U32.show(h))
194 Bool.pick(P.Step, String.is_empty(now) || List.contains(~String, ~String.eq, ours, url_port(now)),
195 Bool.pick(P.Step, String.eq(now, target), P.Current{"serve :" ++ U32.show(h)}, P.ServePort{h, target, tailscale}),
196 P.Blocked{what, "tailnet port " ++ U32.show(h) ++ " is served to " ++ now ++ ", which is not V's"})