Update the example for receiving events

Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
Fabio José 2019-08-06 12:04:56 -03:00
parent bc27bb1d16
commit 8c25af4318
1 changed files with 3 additions and 2 deletions

View File

@ -225,7 +225,8 @@ or a structured version of transport binding.
```js
// some parts were removed //
var Unmarshaller02 = require("cloudevents-sdk/http/unmarshaller/v02");
const v02 = require("cloudevents-sdk/v02");
const unmarshaller = new v02.HTTPUnmarshaller();
// some parts were removed //
@ -240,7 +241,7 @@ app.post('/', function (req, res) {
})
.catch(err => {
console.error(err);
res.status(400)
res.status(415)
.header("Content-Type", "application/json")
.send(JSON.stringify(err));
});