File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ addParseCloud();
24
24
// and delete
25
25
// "databaseURI": a uri like mongodb://localhost:27017/dbname to tell us
26
26
// what database this Parse API connects to.
27
- // "cloud": relative location to cloud code to require
27
+ // "cloud": relative location to cloud code to require, or a function
28
+ // that is given an instance of Parse as a parameter. Use this instance of Parse
29
+ // to register your cloud code hooks and functions.
28
30
// "appId": the application id to host
29
31
// "masterKey": the master key for requests to this app
30
32
// "facebookAppIds": an array of valid Facebook Application IDs, required
@@ -52,7 +54,14 @@ function ParseServer(args) {
52
54
}
53
55
if ( args . cloud ) {
54
56
addParseCloud ( ) ;
55
- require ( args . cloud ) ;
57
+ if ( typeof args . cloud === 'function' ) {
58
+ args . cloud ( Parse )
59
+ } else if ( typeof args . cloud === 'string' ) {
60
+ require ( args . cloud ) ;
61
+ } else {
62
+ throw "argument 'cloud' must either be a string or a function" ;
63
+ }
64
+
56
65
}
57
66
58
67
cache . apps [ args . appId ] = {
You can’t perform that action at this time.
0 commit comments