It depends on how you are running the parse-server and how do you want to configure it. If using the stock docker image, there are two pieces to configure:
- Interop of the parse-server with the live query server - it needs the livequeryserver url and what classNames can be monitored. This is the
liveQuerypart of the config. - Instruct parse-server to start the live query server (ParseLiveQueryServer). This is either the
startLiveQueryServer: trueoption or a dedicated options object for initializing the live query severliveQueryServerOptions
Note that these options also have their env variable equivalents if you prefer to configure that way.
{
"appId": "yourAppId",
"masterKey": "yourMasterKey",
"databaseURI": "mongodb://your-mongodb-url",
"cloud": "./cloud/main.js",
"serverURL": "http://localhost:1337/parse",
"liveQuery": {
"classNames": ["YourClassName"], // Classes to be monitored by LiveQuery
"liveQueryServerURL": "ws://localhost:1337" // WebSocket URL for LiveQuery
},
"startLiveQueryServer": true
"port": 1337, // Port where the Parse Server will run
"publicServerURL": "http://localhost:1337/parse", // Public URL of your Parse Server
"allowClientClassCreation": true // (Optional) Allows clients to create new classes, typically used during development
}
note that you need to set "startLiveQueryServer": true so the server is started, or add this to config.json as well:
"liveQueryServerOptions": {
"logLevel": "info", // Logging level for the Live Query server
"redisURL": "redis://localhost:6379" // Redis URL for distributed setups
},