Adds ability to run livequery server on different port (appengine) (#2892)
* Adds ability to run livequery server on different port (appengine)
This commit is contained in:
committed by
Arthur Cinader
parent
86f35014f4
commit
5dc24334a5
@@ -199,7 +199,7 @@ export default {
|
||||
help: "Run with cluster, optionally set the number of processes default to os.cpus().length",
|
||||
action: numberOrBoolParser("cluster")
|
||||
},
|
||||
"liveQuery.classNames": {
|
||||
"liveQuery": {
|
||||
help: "parse-server's LiveQuery configuration object",
|
||||
action: objectParser
|
||||
},
|
||||
@@ -214,6 +214,10 @@ export default {
|
||||
help: "Starts the liveQuery server",
|
||||
action: booleanParser
|
||||
},
|
||||
"liveQueryPort": {
|
||||
help: 'Specific port to start the live query server',
|
||||
action: numberParser("liveQueryPort")
|
||||
},
|
||||
"liveQueryServerOptions": {
|
||||
help: "Live query server configuration options (will start the liveQuery server)",
|
||||
action: objectParser
|
||||
|
||||
@@ -35,7 +35,13 @@ function startServer(options, callback) {
|
||||
|
||||
var server = app.listen(options.port, callback);
|
||||
if (options.startLiveQueryServer || options.liveQueryServerOptions) {
|
||||
ParseServer.createLiveQueryServer(server, options.liveQueryServerOptions);
|
||||
let liveQueryServer = server;
|
||||
if (options.liveQueryPort) {
|
||||
liveQueryServer = express().listen(options.liveQueryPort, () => {
|
||||
console.log('ParseLiveQuery listening on ' + options.liveQueryPort);
|
||||
});
|
||||
}
|
||||
ParseServer.createLiveQueryServer(liveQueryServer, options.liveQueryServerOptions);
|
||||
}
|
||||
var handleShutdown = function() {
|
||||
console.log('Termination signal received. Shutting down.');
|
||||
|
||||
Reference in New Issue
Block a user