@@ -170,6 +170,22 @@ console.log(emailAdapter);
170
170
var enableAnonymousUsers = ! ! + ( process . env . ENABLE_ANON_USERS ) ;
171
171
var allowClientClassCreation = ! ! + ( process . env . ALLOW_CLIENT_CLASS_CREATION ) ;
172
172
173
+ var liveQuery = process . env . LIVEQUERY_SUPPORT ;
174
+ console . log ( "LIVEQUERY_SUPPORT: " + liveQuery ) ;
175
+ var liveQueryParam ;
176
+ if ( liveQuery ) {
177
+ var liveQueryClasses = process . env . LIVEQUERY_CLASSES . split ( ',' ) . map ( function ( entry ) {
178
+ return entry . trim ( ) ;
179
+ } ) ;
180
+ console . log ( "LIVEQUERY_CLASSES: " + liveQueryClasses ) ;
181
+
182
+ liveQueryParam = {
183
+ classNames : liveQueryClasses
184
+ } ;
185
+ }
186
+
187
+
188
+
173
189
var api = new ParseServer ( {
174
190
databaseURI : databaseUri || 'mongodb://localhost:27017/dev' ,
175
191
cloud : process . env . CLOUD_CODE_MAIN || __dirname + '/cloud/main.js' ,
@@ -196,7 +212,8 @@ var api = new ParseServer({
196
212
allowClientClassCreation : allowClientClassCreation ,
197
213
//oauth = {},
198
214
appName : process . env . APP_NAME ,
199
- publicServerURL : process . env . PUBLIC_SERVER_URL
215
+ publicServerURL : process . env . PUBLIC_SERVER_URL ,
216
+ liveQuery : liveQueryParam
200
217
//customPages: process.env.CUSTOM_PAGES || // {
201
218
//invalidLink: undefined,
202
219
//verifyEmailSuccess: undefined,
@@ -230,3 +247,8 @@ app.get('/', function(req, res) {
230
247
app . listen ( port , function ( ) {
231
248
console . log ( 'docker-parse-server running on ' + serverURL + ' (:' + port + mountPath + ')' ) ;
232
249
} ) ;
250
+
251
+ if ( liveQuery ) {
252
+ console . log ( "Starting live query server" )
253
+ var parseLiveQueryServer = ParseServer . createLiveQueryServer ( app ) ;
254
+ }
0 commit comments