0.1.3 • Published 6 years ago

marathon-event-bus-mock v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

marathon-event-bus-mock

Package version Package downloads Package license Build Status

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.