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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
api | Object.<string, Server~RpcHandler> | Map of methods to message handler functions | ||
createServer | Server~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