Fogmeister
Fogmeister

Reputation: 77631

Is it possible to called a Parse defined cloud code function from the cloud?

I have several cloud code functions defined like...

Parse.define("getPostsNearby"...
Parse.define("getPostsToday"...
Parse.define("getPostsBlah"...

The only difference is the parameters they take in.

I was wondering if it would be possible to create a function...

Parse.define("getPosts"...

That would analyse the input parameters and then run the relevant cloud code function? Sort of like a routing function. So if a geoPoint is passed into the parameters it will call the getPostsNearby cloud code function and then return the results from that.

Is it possible to do this?

Upvotes: 1

Views: 232

Answers (1)

eth3lbert
eth3lbert

Reputation: 813

Try Parse.Cloud.run(name, data, options) or Parse.Cloud.httpRequest(options)

ref. Parse.Cloud.run, Parse.Cloud.httpRequest

Upvotes: 2

Related Questions