如何将解析仪表板部署到heroku [英] How to deploy parse dashboard to heroku
问题描述
我已经在heroku上部署了分析服务器( https://github.com/ParsePlatform/parse-server )但在heroku上找不到任何部署解析仪表板。任何引用赞赏!
您不应该克隆parse-dashboard存储库。这是使用parse-dashboard作为节点模块的更好方法。
-
创建一个新的节点应用程序:
mkdir my-parse-dashboard
cd my-parse-dashboard
npm init
填写它要求的详细信息。 创建一个git仓库:
git init
另外,您可以将此git存储库推送到远程服务器(例如Bitbucket)。请注意,此存储库应该是私有的,因为它将包含您的主密钥。
安装parse-dashboard软件包: -
使用以下行创建一个
index.js
文件:
要求( '解析-仪表板/解析-仪表板/ index.js');
-
创建一个如下所示的parse-dashboard-config.json文件:
{
apps:[
{
serverURL:your parse server url ,
appId:您的应用程序ID,
masterKey:您的主密钥,
appName:My Parse App
}
],
users:[
{
user:username,
pass:password
}
]
-
更新您的
package.json
file并添加此部分(如果它已经存在,则修改它):
scripts:{
start:node ./index.js --config ./parse-dashboard-config.json --allowInsecureHTTP = 1
}
注意:
allowInsecureHTTP
标志似乎在Heroku上是必需的。感谢@nsarafa。 - 提交所有更改并将它们合并到
master
。 - 创建新的Heroku应用程序:
heroku应用程序:创建my-parse-dashboard
- 运行
git push heroku master
将您的应用部署到Heroku。
npm install parse-dashboard --save
您的仪表板可供互联网上的任何人访问。并且只能通过SSL访问仪表板,否则您的密码将以明文形式发送。阅读此教程,了解如何强制所有在Heroku上使用Cloudflare为您的域名流量。
I have deployed the parse server on heroku (https://github.com/ParsePlatform/parse-server) but can't find anything to deploy the parse dashboard on heroku. Any reference is appreciated!!
You shouldn't have to clone the parse-dashboard repository. Here is a better way using parse-dashboard as a node module.
Create a new node app:
mkdir my-parse-dashboard cd my-parse-dashboard npm init
Fill out the details it asks for.
Create a git repository:
git init
Additionally you can push this git repository to a remote server (e.g. Bitbucket). Note this repository should be private since it will contain your master key.
Install the parse-dashboard package:
npm install parse-dashboard --save
Create an
index.js
file with the following line:require('parse-dashboard/Parse-Dashboard/index.js');
Create a parse-dashboard-config.json file which looks like this:
{ "apps": [ { "serverURL": "your parse server url", "appId": "your app Id", "masterKey": "your master key", "appName": "My Parse App" } ], "users": [ { "user":"username", "pass":"password" } ] }
Update your
package.json
file and add this section (or modify it if it already exists):"scripts": { "start": "node ./index.js --config ./parse-dashboard-config.json --allowInsecureHTTP=1" }
Note: The
allowInsecureHTTP
flag seems to be required on Heroku. Thanks to @nsarafa for this.- Commit all your changes and merge them into
master
. - Create a new Heroku app:
heroku apps:create my-parse-dashboard
- Run
git push heroku master
to deploy your app to Heroku.
Remember to generate a strong password as your dashboard is accessible to anyone on the internet. And make the dashboard only accessible through SSL else your password will be sent in clear text. Read this tutorial on how to force all traffic over SSL on Heroku with Cloudflare for your domain.
这篇关于如何将解析仪表板部署到heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!