koa-json-rpc2
Yet another JSON-RPC2 middleware implementation for koa-js.
Installation
npm install koa-json-rpc2
Usage
var koa = ;var app = ; var koaJsonRpc2 = ; // Create rpc router instance// Option 'limit' to set maximum post size// Limit is 1mb by defaultvar jrpc2 = ; // Register new rpc functionjrpc2; // Register new rpc functionjrpc2; // Add context information that's useful throughout the lifetime of application appcontextsome_string = 'context string'; jrpc2; // Exception handling jrpc2; jrpc2; // Register rpc router as koa middlewareapp; app;
Debug
Set variable DEBUG to koa-json-rpc2 to enable debug output. For instance:
DEBUG=koa-json-rpc2 npm server.js
History
Authors
Dmytro Ryzhykov dark81@gmail.com