From 6b859f13b47164b59408a3b46cac97b98d1b5ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Jos=C3=A9?= Date: Sun, 16 Jun 2019 21:06:34 -0300 Subject: [PATCH] Docs for examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio José --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7cb1d7..0f552cf 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ Official CloudEvents' SDK for JavaScript. Before create an awesome PR, please read our [guidelines](./CONTRIBUTING.md). +## Examples + +To see working examples, point to [examples](./examplpes). + ## Versioning ### Before Spec reaches 1.0 @@ -165,8 +169,19 @@ binding.emit(cloudevent) console.error(err); }); ``` +#### Receiving Events Using Express -#### Receiving +See how to listen to events using +[express](https://github.com/expressjs/express). + +```js + + +``` + +#### Receiving Using our Simple HTTP Server + +See how to listen to events using out simple http server. ```js var Cloudevent = require("cloudevents-sdk"); @@ -181,7 +196,7 @@ var config = { // The binding instance var binding = new Cloudevent.bindings["http-structured0.2"](config); -binding.receive() +binding.listen() .then(cloudevent => { // do something with event })