marathon-event-bus-mock
v0.1.3
Published
Create a mock Marathon's Event Bus, and send events to SSE clients
Downloads
7
Maintainers
Readme
marathon-event-bus-mock
A server to mock Marathon's (Server Sent) Event Bus.
Installation
Install as a dependency like this:
npm install marathon-event-bus-mock --save
Usage
To launch a MarathonEventBusMockServer
on port 8080
, you can do the following:
"use strict";
// Use MarathonEventBusMockServer
const MarathonEventBusMockServer = require("marathon-event-bus-mock");
// Instantiate MarathonEventBusMockServer on port 8080
const server = new MarathonEventBusMockServer(8080);
// Send random events every 2000ms
server.sendEvents(2000);
By default, it will publish Marathon >=v1.4 events. As those differ from former versions, you can use
const server = new MarathonEventBusMockServer(8080, true);
to enable the legacy events.