chore(docs): Fix minor import problems in README (#374)
Signed-off-by: Ali Ok <aliok@redhat.com>
This commit is contained in:
parent
97cf2f7785
commit
ed8148326b
|
@ -52,7 +52,7 @@ for `headers` and `body`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const axios = require("axios").default;
|
const axios = require("axios").default;
|
||||||
const { HTTP } = require("cloudevents");
|
const { HTTP, CloudEvent } = require("cloudevents");
|
||||||
|
|
||||||
const ce = new CloudEvent({ type, source, data });
|
const ce = new CloudEvent({ type, source, data });
|
||||||
const message = HTTP.binary(ce); // Or HTTP.structured(ce)
|
const message = HTTP.binary(ce); // Or HTTP.structured(ce)
|
||||||
|
@ -69,7 +69,7 @@ You may also use the `emitterFor()` function as a convenience.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const axios = require("axios").default;
|
const axios = require("axios").default;
|
||||||
const { emitterFor, Mode } = require("cloudevents");
|
const { emitterFor, Mode, CloudEvent } = require("cloudevents");
|
||||||
|
|
||||||
function sendWithAxios(message) {
|
function sendWithAxios(message) {
|
||||||
// Do what you need with the message headers
|
// Do what you need with the message headers
|
||||||
|
|
Loading…
Reference in New Issue