0.2.3 • Published 5 years ago
river-http-node v0.2.3
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-nodeImporting
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