initServer static method
Server
initServer(
- TelepactSchema schema,
- Future<
Message> handler(- Message im
- ServerOptions options
Initializes the server with the schema, handler function, and options.
Implementation
static b.Server initServer(b.TelepactSchema schema,
Future<Message> Function(Message im) handler, ServerOptions options) {
JSPromise outerHandler(b.Message om) {
final m = Message.fromJS(om);
return handler(m).then((response) {
return response._message;
}).toJS;
}
return b.Server(schema, outerHandler.toJS, options._options);
}