如何在AWS托管的Parse服务器上部署云代码 [英] How to deploy cloud code on AWS hosted Parse server

查看:91
本文介绍了如何在AWS托管的Parse服务器上部署云代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是AWS Elastic beantalk的新手.我已经使用解析服务器示例链接" 中的部署到AWS"按钮部署了解析示例服务器.我想更新main.js中的云代码,但是我不知道如何像在终端中使用Parse一样部署云代码.

I am new to AWS elastic beanstalk. I have deployed the Parse example server using deploy to AWS button in the Parse Server Example Link. I want to update the cloud code in main.js but I don't know how can I deploy the cloud code the way I was deploying with Parse in terminal.

推荐答案

您需要在计算机上本地拥有解析服务器示例".然后,在该文件夹中设置EB CLI工具,以便您可以使用eb deploy进行部署.

You need to have the Parse Server Example locally on your machine. Then, setup the EB CLI tool in that folder so that you can deploy using the eb deploy.

确保您在index.js中指示要启用CloudCode的ParseServer:

Make sure that you indicate to the ParseServer in index.js that you want CloudCode enabled:

var api = new ParseServer({
  ...
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  ...

我正在使用环境变量来配置路径.

I am using environment variables for configuration of the path.

要更新您的Parse Cloud Code,请在文件结构中包含main.js文件的"cloud"文件夹.将您现有的Cloud Code粘贴到此文件中,然后将更新部署到AWS.这是我要做的所有事情,而且有效.

To update your Parse Cloud Code there is "cloud" folder in the file structure that contains a main.js file. Paste your existing Cloud Code into this file and then deploy the update to AWS. This is all I had to do for mine and it works.

这篇关于如何在AWS托管的Parse服务器上部署云代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆