Until now SCUA made requests. As of 0.13.0 it can answer them:
http.serve(handler, { bind = "127.0.0.1:8080" })
The handler is an ordinary function over a request record. The host accepts connections, frames the HTTP, and calls your handler; your code sees a record in and returns a response out.
Listening is its own authority. --allow-serve=ADDR:PORT
is deliberately separate from the outbound net grant,
because accepting connections from the world and making requests to it
are different powers. A script you granted fetch access cannot quietly
open a port.
The property we most wanted to keep: serve handlers live inside the same persistable world as everything else. Snapshot a partition while it is serving, restore it, and the server picks up where it left off. A handler with a request in flight follows the interruption rule from the async work, so restore never double-fires a side effect. Live-ops services that survive their own redeploys are the point of this language, and the server had to hold that bar too.