From 4bda6e49e4e78573a4160542f28f6c260906c0f3 Mon Sep 17 00:00:00 2001 From: Taylor Stine Date: Mon, 1 Feb 2016 15:41:22 -0500 Subject: [PATCH] Added cloud funciton argument --- index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 79a32198..ae526e19 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,14 @@ function ParseServer(args) { } if (args.cloud) { 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] = {