mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 19:45:26 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
12
examples/event/subscribe/node/subscribeToATopic.js
Executable file
12
examples/event/subscribe/node/subscribeToATopic.js
Executable file
@@ -0,0 +1,12 @@
|
||||
const { EventService } = require("m3o/event");
|
||||
|
||||
// Subscribe to messages for a given topic.
|
||||
async function subscribeToAtopic() {
|
||||
let eventService = new EventService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await eventService.subscribe({
|
||||
topic: "user",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
subscribeToAtopic();
|
||||
Reference in New Issue
Block a user