Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is your workflow for testing Cloud Code on Parse?

so I'm working developing a fair bit of business logic in the beforeSave/afterSave/etc. type webhooks using Parse.com. As a Javacscript/Parse novice, I'm finding the flow slightly tedious and am wondering if I am approaching it correctly.

  • On the iOS side I send a test PFObject
  • This activates my beforeSave() function for that class
  • I hit a syntax error
  • Check the console logs/errors until I come up with a solution
  • Fix the error in a text editor
  • Save and run 'parse deploy'

Repeat ad nauseam.

Can I be using something like Rest Console/Postman to set up my JSON request? Can I be checking more syntax locally instead of having to run Parse Deploy every time I change an arbitrary piece of code? Is there any sort of improved debugging I could be using like XCode/etc?

Thanks.

like image 853
CDM Avatar asked Dec 14 '14 15:12

CDM


1 Answers

In Parse CLI, there's a command to do the following:

develop app
  Monitors for changes to source files and uploads updated files to Parse.
  This will also monitor the parse INFO log for any new log messages and write
  out updates to the terminal.  This requires an app to be provided, to
  avoid running develop on production apps accidently.

Run parse develop MyApp inside your Parse Cloud code root folder (where you execute parse deploy).

Once done, the terminal will be interactive - any changes made on the source code will be updated automatically. I created a copy of MyApp to differentiate between Production/Development so I don't accidentally push codes.

Then I use Postman, to check my response like following: My sample request

p/s: Use x-www-form-urlencoded on Postman to request with parameter.

like image 126
Ikmal Ezzani Avatar answered Oct 19 '22 23:10

Ikmal Ezzani