mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 11:15:12 +00:00
18 lines
376 B
JavaScript
Executable File
18 lines
376 B
JavaScript
Executable File
const { EventService } = require("m3o/event");
|
|
|
|
// Publish a event to the event stream.
|
|
async function publishAnEvent() {
|
|
let eventService = new EventService(process.env.MICRO_API_TOKEN);
|
|
let rsp = await eventService.publish({
|
|
message: {
|
|
id: "1",
|
|
type: "signup",
|
|
user: "john",
|
|
},
|
|
topic: "user",
|
|
});
|
|
console.log(rsp);
|
|
}
|
|
|
|
publishAnEvent();
|