解析服务器CloudCode - 更新云文件夹时AWS Elastic Beanstalk中的502 Bad Gateway

时间:2016-05-03 21:25:48

标签: amazon-web-services elastic-beanstalk cloud-code aws-cli parse-server

所以我在这里使用按下按钮方法在AWS EB上创建了我的Parse Server:

https://github.com/ParsePlatform/parse-server-example

然后它设置好了。然后我在我的本地机器上创建了一个目录(我已经安装了EB CLI)并运行了以下命令,名称已更改,并且出于隐私目的而遗漏了一些行:

mkdir myparseservernames
cd myparseservernames
eb init
eb labs download

然后我进入了云文件夹并更改了main.js来说:

Parse.Cloud.define('hello', function(req, res) {
  res.success('Hi');
});

require('cloud/myjobs.js');

然后我创建了我的jobs.js文件,然后说:

Parse.Cloud.job('deleteOldPosts', function(request, status) {
    // All access
    Parse.Cloud.useMasterKey();

    var today = new Date();
    var days = 0;
    var time = (days * 24 * 3600 * 1000);
    var expirationDate = new Date(today.getTime() - (time));

    var query = new Parse.Query('gameScore');
    query.lessThan('createdAt', expirationDate);
    query.each(function(post) {
        return post.destroy();
    }).then(function() {
        console.log("Delete job completed.");
        status.success("Delete job completed.");
    }, function(error) {
        alert("Error: " + error.code + " " + error.message);
        status.error("Error: " + error.code + " " + error.message);
    });
});

然后我退回到根文件夹并进行了部署'并将其上传到我的AWS服务器。现在,单击环境URL时出现502 Bad Gateway错误。有谁知道为什么会这样,修复是什么?

0 个答案:

没有答案