美文网首页
熟练搭建parse

熟练搭建parse

作者: 于桓 | 来源:发表于2018-12-31 16:28 被阅读4次

    安装nodejs

    sudo apt-get install nodejs
    需要安装8.x以上的版本

    安装MongoDB

    安装mongodb
    mkdir -p ~/mongo ~/mongo/db
    cd ./mongo/
    docker run -p 27017:27017 -v ~/mongo/db:/data/db -d mongo

    克隆parse-server-example

    git clone https://github.com/ParsePlatform/parse-server-example.git

    parse-server-example

    cd ~/parse-server-example
    npm install

    #vim index.js
    var api = new ParseServer({
      databaseURI:  'mongodb://127.0.0.1:27017/dev',
      cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
      appId:  'App_ID',//加上自己的id
      masterKey:  'Master_Key', //Add your master key here. Keep it secret!加上自己的key
      serverURL: process.env.SERVER_URL || 'http://0.0.0.0:1337/parse',  // Don't forget to change to https if needed
      liveQuery: {
        classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
      }
    });
    
    

    安装dashboard

    npm install -g parse-dashboard

    写一个配置文件

    新建配置文件为dashboard-config.jsons

    {
      "apps": [
        {
          "serverURL": "http://SERVER_IP:1337/parse",
          "appId": "App_ID",
          "masterKey": "Master_Key",
          "appName": "App_Name"
        }
      ],
      "users": [
          {
               "user":"username",
               "pass":"password"
          }
      ]
    }
    

    运行parse-dashboard

    parse-dashboard --config dashboard-config.jsons --allowInsecureHTTP

    相关文章

      网友评论

          本文标题:熟练搭建parse

          本文链接:https://www.haomeiwen.com/subject/atqwlqtx.html