UNPKG

raptor-rpc

Version:

Raptor RPC is a transport-agnostic RPC server with middleware support and an easy to use api. It will allow you to have a server up and running in a matter of minutes, without limiting you to a specific transport.

20 lines (18 loc) 318 B
exports.rejected = function (id, err) { return { jsonrpc: '2.0', id: id, error: { code: Number(err.rpcCode || 0), message: String(err.message), data: err.rpcData } } } exports.resolved = function (id, result) { return { jsonrpc: '2.0', id: id, result: result } }