Parse本地部署

Parse是一个加速应用开发的开源Node.js框架。

在本地安装运行Parse Server的步骤如下

1.安装所需要的组件

本地部署Parse Server需要的组件

  • parse-server
  • mongodb-runner
  • parse-dashboard
sudo npm install -g parse-server  mongodb-runner parse-dashboard

2.启动MongoDB

mongodb-runner start

3.启动Parse Server

parse-server --appId APPLICATION_ID --clientKey CLIENT_KEY --masterKey MASTER_KEY --databaseURI mongodb://localhost/test

4.启动Parse Dashboard

parse-dashboard --dev --appId APPLICATION_ID --masterKey MASTER_KEY --serverURL http://localhost:1337/parse --appName MY_APP

在浏览器中打开网址 http://localhost:4040/

5.Parse Rest接口查询关联数据的例子

curl -X GET \
-H "X-Parse-Application-Id: APPLICATION_ID" \
-H "X-Parse-Master-Key: MASTER_KEY" --data-urlencode 'where={"$relatedTo":{"object":{"__type":"Pointer","className":"Form", "objectId": "cgwiXC8gcd"}, "key": "Subject"}}' \
http://localhost:1337/parse/classes/Subjects