@@ -8,6 +8,7 @@ const fillServerURLs = url => ({
88 stats : url ,
99 engine : url ,
1010 api : url ,
11+ rtm : url ,
1112} ) ;
1213
1314function getDefaultServerURLs ( appId ) {
@@ -30,6 +31,7 @@ function getDefaultServerURLs(appId) {
3031 stats : `https://${ id } .stats.${ domain } ` ,
3132 engine : `https://${ id } .engine.${ domain } ` ,
3233 api : `https://${ id } .api.${ domain } ` ,
34+ rtm : `https://${ id } .rtm.${ domain } ` ,
3335 } ;
3436}
3537
@@ -38,10 +40,11 @@ let _disableAppRouter = false;
3840/**
3941 * URLs for services
4042 * @typedef {Object } ServerURLs
41- * @property {String } [api] serverURL for api service
43+ * @property {String } [api] serverURL for API service
4244 * @property {String } [engine] serverURL for engine service
4345 * @property {String } [stats] serverURL for stats service
4446 * @property {String } [push] serverURL for push service
47+ * @property {String } [rtm] serverURL for LiveQuery service
4548 */
4649
4750/**
@@ -102,9 +105,14 @@ AV.init = function init(options, ...params) {
102105 if ( realtime ) {
103106 AV . _config . realtime = realtime ;
104107 } else if ( AV . _sharedConfig . liveQueryRealtime ) {
108+ const { api, rtm } = AV . _config . serverURLs ;
105109 AV . _config . realtime = new AV . _sharedConfig . liveQueryRealtime ( {
106110 appId,
107111 appKey,
112+ server : {
113+ api,
114+ RTMRouter : rtm ,
115+ } ,
108116 } ) ;
109117 }
110118} ;
0 commit comments