Added cloud funciton argument

This commit is contained in:
Taylor Stine
2016-02-01 15:41:22 -05:00
parent 522abdf606
commit 4bda6e49e4

View File

@@ -51,7 +51,14 @@ function ParseServer(args) {
} }
if (args.cloud) { if (args.cloud) {
addParseCloud(); addParseCloud();
require(args.cloud); if (typeof args.cloud === 'function') {
args.cloud(Parse)
} else if (typeof args.cloud === 'string') {
require(args.cloud);
} else {
throw "argument 'cloud' must either be a string or a function";
}
} }
cache.apps[args.appId] = { cache.apps[args.appId] = {