Skip to content

Module: synapse

Index

References

Classes

Functions

References

Collection

• Collection:


Field

• Field:


Resource

• Resource:


Schema

• Schema:


State

• State:


abstract

• abstract:


control

• control:


decorators

• decorators:


fields

• fields:


protocol

• protocol:


utility

• utility:

Functions

synapse

▸ synapse(directory: string, accept: Array‹string› | Promise‹Array‹string››, join: Array‹string› | Promise‹Array‹string››): object

Defined in lib/index.ts:16

Initializes API request handlers from Controllable type definitions in the given directory.

Parameters:

Name Type Default Description
directory string - A directory containing Controllable type definitions.
accept Array‹string› | Promise‹Array‹string›› [] An array or Promise resolving to an array containing the IP addresses of all peer servers.
join Array‹string› | Promise‹Array‹string›› [] An array or Promise resolving to an array containing the WebSocket connection URIs all peer servers.

Returns: object

An object containing properties ws, http, and sse, whose values are request handlers for the respective protocol.