Skip to content

Commit

Permalink
chore: Update readme with correct Receiver usage (#287)
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
  • Loading branch information
lholmquist authored Jul 29, 2020
1 parent 07e0bef commit e219a30
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```

Expand Down Expand Up @@ -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

0 comments on commit e219a30

Please # to comment.