def http.serve_from
ezmcp@0.1.0.0 · src/io.bend:171
import ezmcp@0.1.0.0/src/io.bend as Io
import Base
import emerging-ezjson@1.2.0.0/src/value.bend as Value
import emerging-ezhttp@0.21.0.0/main.bend as Ez
import ezmcp@0.1.0.0/src/rpc.bend as Rpc
import ezmcp@0.1.0.0/src/server.bend as Server
171
172def http.serve_from(
173 ~C: Data,
174 ~srv: C -> Server.Server,
175 ~run: C -> String -> Value.Json -> IO(Rpc.Out),
176 ~path: String,
177 ~origins: List<&2, String>,
178 +ctx: C,
179 host: String,
180 port: U32,
181 limit: U32,
182 +max: U32
183) -> IO(Unit):
184 Ez.http.serve_io_with(~C,
185 ~(c => req => http.answer_from(C, srv, run, path, origins, c, req)), ctx,
186 host, port, limit, max)