Creating a repository for easy LiveQuery testing

Words
180
Reading
1 min
Listen
Play
9y

image.png

Lately I have been working freelance for a project that was using parse-server in its back end and was tasked to implement the LiveQuery feature that allows users to receive instant updates of the mongodb database.

Although my work didn't involve working on the front end, I needed a way to test what I was doing and found nothing around, so I created this repository with the code you need to get started. Indeed, the Parse documentation is very sParse and even if the code is quite short it took me a while to figure it out playing with the different parameters.

These commits created the current test version.

Once your parse-server is setup you just need to change the four parameters at the begining of the main.js file:

  • AppId
  • MasterKey
  • Server Url
  • Name of the collection using LiveQuery

Then, run this by doing:

npm install
node main.js

You should see connection opened pretty much right away if the parameters are right.
You can then send cURL commands to test your parse-server to create objects of the Collection you specified. You should then see : object created.appear in the terminal.

That will mean you re all setup.

Hope this will help! I really wished I found this when I started working on this project.



Posted on Utopian.io - Rewarding Open Source Contributors

Creating a repository for easy LiveQuery testing | Ecency