如何将解析仪表板部署到heroku [英] How to deploy parse dashboard to heroku

查看:169
本文介绍了如何将解析仪表板部署到heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在heroku上部署了分析服务器( https://github.com/ParsePlatform/parse-server )但在heroku上找不到任何部署解析仪表板。任何引用赞赏!

解决方案

您不应该克隆parse-dashboard存储库。这是使用parse-dashboard作为节点模块的更好方法。


  1. 创建一个新的节点应用程序:

      mkdir my-parse-dashboard 
    cd my-parse-dashboard
    npm init

    填写它要求的详细信息。 创建一个git仓库:

      git init 

    另外,您可以将此git存储库推送到远程服务器(例如Bitbucket)。请注意,此存储库应该是私有的,因为它将包含您的主密钥。

  2. 安装parse-dashboard软件包:

      npm install parse-dashboard --save 


  3. 使用以下行创建一个 index.js 文件:

     要求( '解析-仪表板/解析-仪表板/ index.js'); 


  4. 创建一个如下所示的parse-dashboard-config.json文件:

      {
    apps:[
    {
    serverURL:your parse server url ,
    appId:您的应用程序ID,
    masterKey:您的主密钥,
    appName:My Parse App
    }
    ],
    users:[
    {
    user:username,
    pass:password
    }
    ]


  5. 更新您的 package.json file并添加此部分(如果它已经存在,则修改它):

     scripts:{
    start:node ./index.js --config ./parse-dashboard-config.json --allowInsecureHTTP = 1
    }

    注意: allowInsecureHTTP 标志似乎在Heroku上是必需的。感谢@nsarafa。


  6. 提交所有更改并将它们合并到 master

  7. 创建新的Heroku应用程序: heroku应用程序:创建my-parse-dashboard

  8. 运行 git push heroku master 将您的应用部署到Heroku。

您的仪表板可供互联网上的任何人访问。并且只能通过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.

  1. Create a new node app:

    mkdir my-parse-dashboard
    cd my-parse-dashboard
    npm init
    

    Fill out the details it asks for.

  2. 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.

  3. Install the parse-dashboard package:

    npm install parse-dashboard --save
    

  4. Create an index.js file with the following line:

    require('parse-dashboard/Parse-Dashboard/index.js');
    

  5. 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"
        }
      ]
    }
    

  6. 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.

  7. Commit all your changes and merge them into master.
  8. Create a new Heroku app: heroku apps:create my-parse-dashboard
  9. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆