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

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

问题描述

我是 AWS 弹性 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.

推荐答案

您需要在您的机器上本地安装 Parse Server Example.然后,在该文件夹中设置 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 中向 ParseServer 表明您希望启用 CloudCode:

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 代码,文件结构中有一个包含 main.js 文件的cloud"文件夹.将您现有的云代码粘贴到此文件中,然后将更新部署到 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天全站免登陆