Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud code: can I use other files besides main.js?

Does all my cloud clode have to be in main.js or can I create other logical files and somehow add them into my cloud code?

like image 557
Alon Raskin Avatar asked Oct 13 '14 19:10

Alon Raskin


1 Answers

If you just want to split your Parse.Cloud functions in multiple files, you also can do that and just require the file in your main.js.

So you can have this in your cloud/main.js

require('cloud/userFunctions.js')

and have all the related functions in your cloud/userFunctions.js

Parse.Cloud.define("processUserRequest", function(request, response) {

// do your stuff

});
like image 56
Diogo Andre Avatar answered Dec 07 '22 17:12

Diogo Andre