我在AWS中托管了Bitnami解析服务器作为HTTP服务。我无法通过其仪表板在解析服务器中创建新的应用程序。我还尝试了在该演示中使用Bitnami解析服务器的1小时演示,我也无法创建新的应用程序。怎么做?
https://bitnami.com/stack/parse
我也无法通过REST API实现这一点。因为演示站点不需要凭据登录。 / 1 / apps API调用需要电子邮件/密码才能创建应用。
如何在此演示网站中创建应用程序?
答案 0 :(得分:3)
Bitnami开发人员,
很遗憾,您无法使用演示网站创建新的应用。请注意,此应用程序将提供另一个API。为此,您需要通过SSH访问并编辑 /opt/bitnami/apps/parse/htdocs/server.js 文件。例如,您可以使用以下代码获得2个应用:
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var app = express();
//API 1
var api1 = new ParseServer({
databaseURI: "mongodb://root:password@127.0.0.1:27017/bitnami_parse1",
cloud: "./node_modules/parse-server/lib/cloud-code/Parse.Cloud.js",
appId: "myappid1",
masterKey: "mymasterkey1",
fileKey: "myfilekey1",
serverURL: 'http://X.X.X.X:80/parse1'
});
app.use('/parse1', api1);
//API 2
var api2 = new ParseServer({
databaseURI: "mongodb://root:password@127.0.0.1:27017/bitnami_parse",
cloud: "./node_modules/parse-server/lib/cloud-code/Parse.Cloud.js",
appId: "myappid2",
masterKey: "mymasterkey2",
fileKey: "myfilekey2",
serverURL: 'http://X.X.X.X:80/parse2'
});
app.use('/parse2', api2);
var port = 1337;
app.listen(port, function() {
console.log('parse-server running on port ' + port);
});
//Parse Dashboard
var ParseDashboard = require('parse-dashboard');
var dashboard = new ParseDashboard({
apps: [
{
appName: "myapp1",
appId: 'myappid1',
masterKey: 'mymasterkey1',
fileKey: 'myfilekey1',
production: true,
serverURL: 'http://X.X.X.X:80/parse1'
}
,
{
appName: "myapp2",
appId: 'myappid2',
masterKey: 'mymasterkey2',
fileKey: 'myfilekey2',
production: true,
serverURL: 'http://X.X.X.X:80/parse2'
}
]
,
"users": [
{
"user":"user",
"pass":"password"
}
]
});
app.use('/', dashboard);
var portdash = 4040;
app.listen(portdash, function() {
console.log('parse-dashboard running on port ' + portdash);
});
然后,您需要将以下行添加到 /opt/bitnami/apps/parse/conf/httpd-app.conf 以设置Apache ProxyPass配置:
ProxyPass /parse1 http://127.0.0.1:1337/parse1
ProxyPassReverse /parse1 http://127.0.0.1:1337/parse1
ProxyPass /parse2 http://127.0.0.1:1337/parse2
ProxyPassReverse /parse2 http://127.0.0.1:1337/parse2
然后重新启动正在执行的服务:
$ sudo /opt/bitnami/ctlscript.sh restart
我希望你觉得它很有用。