chore: Update readme with correct Receiver usage (#287)

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
This commit is contained in:
Lucas Holmquist 2020-07-29 18:48:14 -04:00 committed by GitHub
parent 07e0bef696
commit e219a30708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -39,11 +39,8 @@ const {
Receiver
} = require("cloudevents");
// Create a receiver to accept events over HTTP
const receiver = new Receiver();
// body and headers come from an incoming HTTP request, e.g. express.js
const receivedEvent = receiver.accept(req.headers, req.body);
const receivedEvent = Receiver.accept(req.headers, req.body);
console.log(receivedEvent);
```
@ -157,4 +154,4 @@ We love contributions from the community! Please check the
for information on how to get involved.
[v1spec]: https://github.com/cloudevents/spec/tree/v1.0
[v103pec]: https://github.com/cloudevents/spec/tree/v0.3
[v103pec]: https://github.com/cloudevents/spec/tree/v0.3