AWS Hosted Parse-server 找不到云代码

AWS Hosted Parse-server can't find cloud code

我们正在从 parse.com 迁移到 AWS。 该解决方案在本地工作得很好,但是一旦我 eb deploy 到 AWS,它就无法加载云代码文件。

Error: Cannot find module '/cloud/main.js'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at new ParseServer (/var/app/current/node_modules/parse-server/lib/ParseServer.js:268:9)
    at new _ParseServer (/var/app/current/node_modules/parse-server/lib/index.js:38:16)
    at Object.<anonymous> (/var/app/current/index.js:8:11)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)

我的解析服务器配置如下所示:

var api = new ParseServer({
    databaseURI: config.DATABASE_URI ,
    cloud:  __dirname + '/cloud/main.js' ,
    appId: config.parse.APP_ID,
    masterKey: config.parse.MASTER_KEY ,
    restApiKey: config.parse.REST_API_KEY,
    serverURL: config.parse.SERVER_URL   // Don't forget to change to https if needed
});

AWS 显然找不到文件@ __dirname + '/cloud/main.js' 我应该为 AWS 设置什么?

所以我刚刚删除了前导 /,现在可以使用了。

现在显示为cloud: 'cloud/main.js' ,