def route

ezmcp@0.1.0.0 · src/web.bend:187

import ezmcp@0.1.0.0/src/web.bend as Web
import Base
import ezmcp@0.1.0.0/src/server.bend as Server

187# the decision over a request's parts: the path first, then the Origin, then
188# the method, then the protocol version (its MCP-Protocol-Version header,
189# empty when absent), then the body
190def route(
191  srv: Server.Server,
192  here: Bool,
193  allowed: Bool,
194  is_post: Bool,
195  header: String,
196  body: String
197) -> Web:
198  match here:
199    case False{}:
200      text(404, "Not Found")
201    case True{}:
202      origin(srv, body, header, is_post, allowed)

Uses (6)

Used by (1)