Express 中间件 express-jsonrpc2
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/yuhere/express-jsonrpc2
- 软件文档: https://github.com/yuhere/express-jsonrpc2/blob/master/README.md
软件介绍
Express.js 的 JSON-RPC version 2 实现
express-jsonrpc2 是node.js上的express库的完整JSON-RPC version 2服务端实现,是express的中间件。
安装
npm install express-jsonrpc2
使用
var path = require('path'),
express = require('express'),
app = express(); var JsonRPC = require('express-jsonrpc2'),
PropTypes = JsonRPC.PropTypes,
_repository = JsonRPC.Repository(); _repository.regsiter({
namespace: 'add',
doc: 'addition of 2 numbers.',
sign: [PropTypes.number, PropTypes.number, PropTypes.number]
}, function (a, b) { return a + b;
}); app.set('port', (process.env.PORT || 5000)); app.use('/', JsonRPC(_repository)); app.listen(app.get('port'), function () { console.log('Node app is running on port', app.get('port'));
});调试
在浏览器中打开 'http://localhost:5000' ,你将看到Debug页面。 在页面的左侧,在树视图中列出了一系列可用的RPC。 点击“添加”,帮助,签名,测试的参数将显示在页面的右侧。
输入文本'[1,2]',然后点击“执行”按钮,3将显示在浏览器的控制台中。
Traction: A Startup Guide to Getting Customers
Gabriel Weinberg、Justin Mares / S-curves Publishing / 2014-8-25 / USD 14.99
Most startups end in failure. Almost every failed startup has a product. What failed startups don't have is traction -- real customer growth. This book introduces startup founders and employees to......一起来看看 《Traction: A Startup Guide to Getting Customers》 这本书的介绍吧!
