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> |
||
---|---|---|
.. | ||
commons.js | ||
constants.js | ||
emitter_binary.js | ||
emitter_binary_0_3.js | ||
emitter_binary_1.js | ||
emitter_structured.js | ||
http_receiver.js | ||
receiver_binary.js | ||
receiver_binary_0_3.js | ||
receiver_binary_1.js | ||
receiver_structured.js | ||
receiver_structured_0_3.js | ||
receiver_structured_1.js | ||
unmarshaller.js | ||
unmarshaller_0_3.js |