LoginSignup
3
5

More than 5 years have passed since last update.

Parse ServerをLocalにインストール

Last updated at Posted at 2018-02-05

超超超久しぶりにParse Serverをローカルにインストールする必要?(ParseServerのデータをFirebaseにMigrationしたいためテスト用...)が出てきたので、忘れないようにメモ....。

OS: macOS High Sierra
Parse-Server:Ver.2.7.2
Parse-DashBoard:Ver.1.1.2

Parse Serverをインストール

$ npm install -g parse-server mongodb-runner

$ mongodb-runner start

//Parse Server起動
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test

注意
APPLICATION_IDとMASTER_KEYは任意の文字列を入れます。
(例:$ parse-server --appId sampletestID --masterKey sampletestKEY --databaseURI mongodb://localhost/test)

(参)https://github.com/parse-community/Parse-Server#getting-started

DashBoardをインストール

Serverをインストールしただけではわかりにくいので、管理画面のDashBoardをインストールします。

git clone git@github.com:ParsePlatform/parse-dashboard.git

cd parse-dashboard

npm install

次に、ブラウザで「http://localhost:4040」にアクセスすれば、DashBoardで見ることができるようになります。

(参)http://mushikago.com/i/?p=7144

設定

次に、parse-dashboard-config.jsonを書き換えてアプリデータを表示できるようにします。

{
  "apps": [{
    "serverURL": "http://localhost:1337/parse",
    "appId": "<APPLICATION_ID>",
    "masterKey": "<MASTER_KEY>",
    "appName": "<App_Name>",
    "iconName": ""
  }],
  "iconsFolder": "icons"
}

【注意】
APPLICATION_ID、MASTER_KEYはServer起動時に設定した物を使用
App_Nameはなんでもいい

・parse-dashboard-config.json書き換え後、ブラウザでDashBoardをリロードして、設定したAppが表示されていればOK
・表示されなければ、一度、Parse-Dashboardを再起動すれば表示されるようになるはずです。
・複数アプリを登録する場合は以下のようにparse-dashboard-config.jsonを書き換えます。

{
  "apps": [{
    "serverURL": "http://localhost:1337/parse",
    "appId": "<APPLICATION_ID>",
    "masterKey": "<MASTER_KEY>",
    "appName": "<App_Name>",
    "iconName": ""
  },{
    "serverURL": "http://localhost:1337/parse",
    "appId": "<APPLICATION_ID>",
    "masterKey": "<MASTER_KEY>",
    "appName": "<別のApp_Name>",
    "iconName": ""
  }],
  "iconsFolder": "icons"
}

(参)http://mushikago.com/i/?p=7144

(おまけ)DashBoardをGlobalにインストールする場合

・npmでインストールします。

npm install -g parse-dashboard

・DashBoard起動は以下のコマンドでOK

parse-dashboard --appId yourAppId --masterKey yourMasterKey --serverURL "https://example.com/parse" --appName optionalName

(参)https://github.com/parse-community/parse-dashboard

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5