oriskami
Advanced tools
Comparing version 1.20.0 to 1.21.0
@@ -119,5 +119,5 @@ var encode = encodeURIComponent | ||
Resource.prototype.list = function(){ | ||
var args = arguments | ||
, parameters = !isFunction(args[0]) ? args[0] : {} | ||
, next = isFunction(args[0]) ? args[0] : isFunction(args[1]) ? args[1] : function(){} | ||
var nArgs = arguments.length | ||
, parameters = nArgs === 1 ? {} : arguments[0] | ||
, next = nArgs === 1 ? arguments[0] : arguments[1] | ||
@@ -124,0 +124,0 @@ this.request.call(this, { |
{ | ||
"name": "oriskami", | ||
"version": "1.20.0", | ||
"version": "1.21.0", | ||
"description": "API wrapper to Oriskami", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -132,2 +132,20 @@ # Oriskami node.js bindings | ||
## Parsing incoming webhooks | ||
Oriskami signs its webhooks according to the Json Web Token standard [www](https://jwt.io/)—here is | ||
how to parse incoming requests with express/restify: | ||
```js | ||
var Oriskami = require("oriskami") | ||
, oriskami = new Oriskami() | ||
oriskami.getPublicKey((err) => { /* Retrieve public key (async) */ | ||
app.post("/webhook/oriskami" /* Endpoint defined as a notification */ | ||
, oriskami.webhook() /* Middleware that parses the Json Web Tokens */ | ||
, (req, res, next) => { | ||
console.log(req.json) | ||
}) | ||
} | ||
``` | ||
## Code snippets and filter parameters | ||
@@ -134,0 +152,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
117074
187