How to deploy cloud code on AWS hosted Parse server

旧时模样 提交于 2019-12-06 05:54:01

问题


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.


回答1:


Try this command:

eb deploy

It will zip your repository, upload to S3 and deploy to eb.

Get the CLI tool: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html




回答2:


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.

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.

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.



来源:https://stackoverflow.com/questions/35665778/how-to-deploy-cloud-code-on-aws-hosted-parse-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!