0.2.3 • Published 4 years ago

river-http-node v0.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

River Server Library

Supported platforms

Node.JS

Installation

River is available as an npm package. In your project's root, type:

npm install river-http-node

Importing

Requiring the module exposes the River constructor:

const River = require("river-http-node");

Configuration

To configure the server, use the River constructor:

const river = new River({
  host: "localhost", // API Gateway endpoint
  key: "apikey", // API Gateway key
});

The endpoint and key are given at the end of the deployment process. Please see the deploy repo for more information.

Usage

To publish a message from your backend, use the publish method:

river.publish("channel", "eventName", data);

This sends an HTTP POST request to River. data can be a string, array, or object. See the client-js repo for how clients receive this event data.

For more examples, see the examples repo.

License

MIT

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.0.1

4 years ago