Commit Graph

14 Commits

Author SHA1 Message Date
Lance Ball b866edddd9
docs: update README and examples with new API (#138)
This commit modifies the README to show new API usage for the
`HTTPReceiver` and `CloudEvent` classes, and updates the examples
to use this as well.

Overall structure and content has been modified to look more like
the sdk-go README.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/128

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-11 09:41:05 -04:00
Lance Ball 5110ad4c67 src,fix: drop support for v0.2 and clean up contenttype
This commit removes support for the v0.2 specification. It also removes the
`contenttype` attribute from the `CloudEvent` object. While the HTTP protocol
binding specifies that in binary mode, the `datacontenttype` attribute should
map to the HTTP Content-Type header, that doesn't mean that the `CloudEvent`
object should have a `contenttype` property.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/61
Fixes: https://github.com/cloudevents/sdk-javascript/issues/66

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-28 17:37:49 -03:00
Lance Ball 3f238a0124
src: add eslint configuration and npm script
Automatically fixed > 2000 issues. The remaining 200+ issues need
to be fixed by hand. Additionally, all strings are double quotes
which is not typically standard and I wonder about fixing that too.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-22 10:15:05 -04:00
Fabio José 36d61f190e Express examples with Spev 1.0
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-06 11:21:53 -03:00
Fabio José c8675ca103 Fix the unmashaller import
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-08-06 12:25:25 -03:00
Fabio José a9dc14f617 Expose the /v02 for spec 0.2 and /v03 for spec 0.3
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-08-06 11:21:57 -03:00
Fabio José 10fbc1df7a Import the new way of require specifications
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-08-05 15:11:39 -03:00
Fabio José 852cad0832 Fix the examples and use the same names
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-25 12:08:04 -03:00
Fabio José e1b04bdcdb Change to use promise
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-25 12:05:02 -03:00
Fabio José b39a32152f Double quotes
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-25 11:02:14 -03:00
Fabio José 6c5b7e2c86 When incorrect, reply the errors too
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-25 10:54:39 -03:00
Fabio José 5baa52dd2b Fix example body read
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-21 16:43:25 -03:00
Fabio José d21881a2b5 WIP: example with expressjs
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-16 21:10:26 -03:00
Fabio José 9b98aad083 Examples folder start with expressjs
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-16 21:05:10 -03:00