Commit Graph

6 Commits

Author SHA1 Message Date
Lance Ball 54f242b79e
feat: expose a mode and version agnostic event receiver (#120)
Event receivers in the wild may not always know what version or mode an
incoming event is. Instead of requiring developers to inspect the headers
themselves, the SDK should provide an HTTP receiver that is capable of
figuring out what the version and mode (structured/binary) of an incoming
event is and handle it appropriately.

In determining the best way to expose this, I chose to modify the API a
little bit. Now, instead of `const CloudEvent = require('cloudevents-sdk');`
users need to destructure it.

```js
const { HTTPReceiver, CloudEvent } = require('cloudevents-sdk');
```

This change should not be backported to 1.x.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-06 13:25:16 -04:00
Grant Timmerman 05ecbdea4f
feat: use CloudEvents not cloudevents everywhere (#101)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-30 16:14:13 -07:00
Lance Ball e83db297ae chore: update eslint rules to disallow var usage
Enforce the use of `let` and `const` by using elsint rules.
When creating the eslint configuration, I had assumed that
`extends: eslint:recommended` would have covered this, but
apparently not!

Existing usage of `var` fixed with `npm run lint -- --fix`.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-30 12:36:04 -03:00
Fabio José 2a7d3ba558 double quotes
Signed-off-by: Fabio José <fabiojose@gmail.com>
2018-12-15 11:19:48 -02:00
Fabio José 109f030b5b Remove commented code
Signed-off-by: Fabio José <fabiojose@gmail.com>
2018-11-14 21:13:21 -02:00
Fabio José 268233fce7 Project start
Signed-off-by: Fabio José <fabiojose@gmail.com>
2018-11-09 16:20:29 -02:00