Backend integration

The Genvid web client needs to access a single service, called the leaf, which provides a websocket server from which the client will access the game data. To get the connection URL for this service, two web requests must be sent to the Disco service API:

The APIs use a secret code for security, so they should only be called from a trusted website. In the Web Sample, we route them inside the backend/streams.js file to the /streams and /channels/join URLs, respectively.

The disco service is registered with Consul and you can find its URL this way.

Commands, notifications, and events integration

The webgateway services expose four different API:

  • POST /commands/game which let you send commands directly to the game.

  • POST /notifications which let you send notifications directly to the viewer.

  • POST /events which let you send a batch of events to the backend for processing before sending it to the event pipeline, instead of directly sending them from the client.

  • POST /reduction/{id} which allow you to apply an action to a reduction, like resetting its value.

These are powerful functionalities which we recommend you do not expose for public use.

See Webgateway service API for more information.