Explorer

html-ui.fly-handle

description
How the public definy server on fly.io handles a request (docs/fly-io.md): /host.js with the host.js of the signed release (html-ui.release-host-script), EventService with the signed events of the accepted accounts (definy.handle-event-service), /mcp (reading only: the server has no account, so the writing tools and definy_receive are off), /healthz, the other RPC and /virtual/wasm/ with definy.handle-request, and the rest with html-ui (read only)
type
Fn(request: @http.request) -> @definy.service-io
expression
fn(request$0) =>
  match @core.equal(left: @http.path(request: $0), right: "/host.js") {
    true =>
      @html-ui.release-host-script(),
    false =>
      @definy.handle-event-service(
        request: $0,
        accept_accounts: ["-mTiIcLsq3lHIa0dsT8Z_mo47RLkGLPjRHTbFDotcJ8"],
        accept_any_account: true,
        otherwise: fn() =>
          match @core.or(
              left: @core.or(
                left: @core.equal(left: @http.path(request: $0), right: "/mcp"),
                right: @core.equal(left: @http.path(request: $0), right: "/healthz")
              ),
              right: @core.or(
                left: @std.string-starts-with(value: @http.path(request: $0), prefix: "/definy.v1."),
                right: @std.string-starts-with(value: @http.path(request: $0), prefix: "/virtual/wasm/")
              )
            ) {
            true =>
              @definy.handle-request(request: $0),
            false =>
              @html-ui.handle(editable: false, request: $0)
          }
      )
  }
visibility
public
html-ui.fly-handle (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: D-z_149QQqfVGc4Zwvk2BXnT8lMmRAxbq6WMuXqBmuA
content hash: fPyKr4ntAncvycL7Qy1VIrVxDvhSLUJsygFy_ODrKlA