我在每个云代码定义中调用了几个函数,我可以将它们引入全局范围并在所有云代码定义中使用它们吗?
答案 0 :(得分:0)
是。 Parse使用节点,而节点允许使用模块。 See here
简而言之:
// in some file, lets call it 'cloud/common.js'
exports.foo = function(x) {
return x+1;
};
// in some other cloud file
var common = require('./common');
var bar = common.foo(1); // bar will be 2