Skip to content

Commit 299d382

Browse files
committed
Add livequery support
1 parent ba7415f commit 299d382

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

Diff for: Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ ENV PARSE_HOME /parse
66
#ADD *.js ${PARSE_HOME}/
77
#ADD *.json ${PARSE_HOME}/
88

9-
ADD index.js ${PARSE_HOME}/
109
ADD package.json ${PARSE_HOME}/
1110

1211
ADD jsconfig.json ${PARSE_HOME}/
@@ -21,6 +20,8 @@ ADD cloud/*.js $CLOUD_CODE_HOME/
2120
WORKDIR $PARSE_HOME
2221
RUN npm install
2322

23+
ADD index.js ${PARSE_HOME}/
24+
2425
## ENV
2526
#ENV APP_ID myAppId
2627
#ENV MASTER_KEY myMasterKey

Diff for: docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ parse-server:
5555
GCP_KEYFILE_PATH: $GCP_KEYFILE_PATH
5656
GCS_BUCKET: $GCS_BUCKET
5757
GCS_DIRECT: $GCS_DIRECT
58+
LIVEQUERY_SUPPORT: $LIVEQUERY_SUPPORT
59+
LIVEQUERY_CLASSES: $LIVEQUERY_CLASSES
5860
links:
5961
- mongo
6062
volumes_from:

Diff for: index.js

+23-1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ console.log(emailAdapter);
170170
var enableAnonymousUsers = !!+(process.env.ENABLE_ANON_USERS);
171171
var allowClientClassCreation = !!+(process.env.ALLOW_CLIENT_CLASS_CREATION);
172172

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+
173189
var api = new ParseServer({
174190
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
175191
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
@@ -196,7 +212,8 @@ var api = new ParseServer({
196212
allowClientClassCreation: allowClientClassCreation,
197213
//oauth = {},
198214
appName: process.env.APP_NAME,
199-
publicServerURL: process.env.PUBLIC_SERVER_URL
215+
publicServerURL: process.env.PUBLIC_SERVER_URL,
216+
liveQuery: liveQueryParam
200217
//customPages: process.env.CUSTOM_PAGES || // {
201218
//invalidLink: undefined,
202219
//verifyEmailSuccess: undefined,
@@ -230,3 +247,8 @@ app.get('/', function(req, res) {
230247
app.listen(port, function() {
231248
console.log('docker-parse-server running on ' + serverURL + ' (:' + port + mountPath + ')');
232249
});
250+
251+
if(liveQuery) {
252+
console.log("Starting live query server")
253+
var parseLiveQueryServer = ParseServer.createLiveQueryServer(app);
254+
}

0 commit comments

Comments
 (0)