setEndpoint method

  1. @override
ClientIO setEndpoint(
  1. String endPoint
)

Set the Appwrite endpoint.

Implementation

@override
ClientIO setEndpoint(String endPoint) {
  if (!endPoint.startsWith('http://') && !endPoint.startsWith('https://')) {
    throw AppwriteException('Invalid endpoint URL: $endPoint');
  }

  _endPoint = endPoint;
  _endPointRealtime = endPoint
      .replaceFirst('https://', 'wss://')
      .replaceFirst('http://', 'ws://');

  return this;
}