通知者客户
简单客户端,从分叉
用法
从npm安装,
$ npm install notifier-client
初始化客户端,
var notifier = require ( 'notifier-client' ) ( {
url : 'http://notifier.example.com/api/events' ,
token : 'your-custom-token'
} ) ;
使用notify方法,
notifier . notify ( {
event : 'user-resistered' ,
user : 'a@a.com' ,
data : { registered : new Date ( ) }
} , function ( ) {
// notified!
} ) ;
或使用to和withData方法,
notifier . no
评论0
最新资源