scarf~ Server

new Server(api, createServeropt, nullable)

Implementation of a scarf server. Takes an API definition and routes JSON-RPC messages to their handlers, automatically transforming scarf:// links into streams.

Parameters:
NameTypeAttributesDefaultDescription
apiObject.<string, Server~RpcHandler>

Map of methods to message handler functions

createServerServer~createServer<optional>
<nullable>
net.createServer

Function returning a duplex stream

Extends

  • EventEmitter

Methods

listen()

Passthrough function that calls the underlying Server~AbstractServer's listen() method