node-routing-json-schema
Define routing using json schema
Load and validate params, result and error json-schema for each method of routing.
var RpcRouting = ;var rpcRouting = ;rpcRouting;rpcRouting; var jsonrpc = ;var Server = jsonrpcserver;var ServerMiddleware = jsonrpctransportsservermiddleware; var jsonRpcMiddlewareServer = rpcRouting;
auth/method/login/index.js:
module { // check login and password here return true;};
auth/method/login/params.json
auth/method/login/result.json:
auth/method/login/error.json:
or auth/method/login/error.js:
moduleexports = "$schema": "http://json-schema.org/draft-04/schema#" "allOf": "anyOf": "type": "object" "required": "code" "message" "properties": "code": "enum": 404 "message": "enum": "Couldn't found account with that login and password" ;