问题
I'm currently trying to create a parse server on AWS using their suggested path of Elastic Beanstalk to simplify the process. There is a very primitive guide here: https://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk
I was able to get this running but I now have a few issues:
1) I am unable to use EB CLI to connect to my instance. The section:
ADVANCED: Updating and Deploying your code states to simply call:
eb init
and pick your application that you created. Then call eb labs download
This only returns an error that no environment has been setup. I try to use eb list
so I can call eb use XXX
but nothing is returned.
2) I want to install the Parse dashboard but have no idea how to log in so I can call npm install.
Any guidance or resources to read on these topics would be very helpful. Even an outline of the steps. I've spent the last 48 hours straight on trying to get this up and running without any luck.
Thanks,
David
回答1:
I can provide an answer to part 2 of your question as I just went through this on AWS for a production Parse Server deployment. I am using the Parse Server Example 1.4.0 as my base and adding mods to the index.js and package.json for this. I originally got everything working following the AWS with Elastic Beanstalk guide. This requires at least Parse Dashboard 1.0.8 because of the fixes to the mounting in express.
In the package.json here is my dependencies list (npm will automatically install these when deploying to AWS):
"dependencies": {
"express": "~4.11.x",
"kerberos": "~0.0.x",
"parse": "~1.8.0",
"parse-server": "~2.2.6",
"parse-dashboard": "~1.0.8"
},
Then, in the index.js add the Parse Dashboard:
...
var ParseServer = require('parse-server').ParseServer;
var ParseDashboard = require('parse-dashboard');
...
// Added near the end of the file after the createLiveQueryServer
// Try to setup the dashboard
var config = {
"apps": [
{
"serverURL": "yourparsedomain" + mountPath,
"appId": "YOUR_APP_ID",
"masterKey": "YOUR_MASTER_KEY",
"javascriptKey": "YOUR_JAVASCRIPT_KEY",
"restKey": "YOUR_REST_KEY",
"appName": "YOUR_APP_NAME",
"appNameForURL": "uniquename",
"production": true
}
],
"users": [
{
"user":"user1",
"pass":"pass1"
},
{
"user":"user2",
"pass":"pass2"
}
]
};
var allowInsecureHTTP = false;
var dash = ParseDashboard(config, allowInsecureHTTP);
app.use('/dash', dash);
If you are not using SSL set allowInsecureHTTP = true;
Now you can access your Parse Dashboard at "yourparsedomain/dash" with user security enabled. The user security is important because you don't want your Master Key getting out in the wild.
来源:https://stackoverflow.com/questions/36492794/advanced-parse-server-setup-on-aws-for-a-developer