Skip to content

river-live/http-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A NodeJS server-side library to interact with the API Gateway

Resources

Stars

Watchers

Forks

Packages

No packages published