Parse and Heroku Service(3)Parse Server and Parse Dashboard

Parse and Heroku Service(3)Parse Server and Parse Dashboard

1 Set Up ENV
Easiest way to start
> npm install -g parse-server

> npm install -g mongodb-runner

> parse-server --appId tester --masterKey tester

Not working on MAC, because of port number?
Unable to listen on port 1337. The port is already in use.

It works using other port.
> parse-server --appId tester --masterKey tester --port=2337
appId: tester
masterKey: ***REDACTED***
port: 2337
mountPath: /parse
maxUploadSize: 20mb
serverURL: http://localhost:2337/parse

parse-server running on http://localhost:2337/parse

Configuration Options
appId, masterKey,
databaseURI - format mongoldb://user:pass@host.com/dbname
port format 2337
serverURL URL to Parse Server, the cloud codes will call these URLs.
cloud - The absolute path to our code main.js file.
push - https://github.com/ParsePlatform/parse-server/wiki/Push

Try to store data from REST API.
> curl -X POST \
> -H "X-Parse-Application-Id: tester" \
> -H "Content-Type: application/json" \
> -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
> http://localhost:2337/parse/classes/GameScore

{"objectId":"KHvvrHnXmW","createdAt":"2016-03-21T21:36:52.293Z"}

Once object is created, we can retrieve the object.
> curl -X GET \
> -H "X-Parse-Application-Id: tester" \
> http://localhost:2337/parse/classes/GameScore/KHvvrHnXmW

{"objectId":"KHvvrHnXmW","score":1337,"playerName":"Sean Plott","cheatMode":false,"updatedAt":"2016-03-21T21:36:52.293Z","createdAt":"2016-03-21T21:36:52.293Z"}

Other SDK to Parse
https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#using-parse-sdks-with-parse-server

In our project, we are using Parse Server + ExpressJS
https://github.com/ParsePlatform/parse-server

2 Parse Dashboard
https://github.com/ParsePlatform/parse-dashboard

Install the dashboard
> npm install -g parse-dashboard

This command works to connect the previous Parse Server
> parse-dashboard --appId tester --masterKey tester --serverURL "http://localhost:2337/parse" --appName tester

Options
port
config for example, parse-dashboard-config.json

Start dashboard with a config file
parse-dashboard-config.json
{
“apps”:[
{
“serverURL” : “http://localhost:2337/parse”,
“appId”: “tester”,
“masterKey”: “tester”,
“appName”: “tester"
}
]
}

Security the Dashboard
{
“apps”:[…],
“users”: [
{
“user”: “carl”,
“pass”: “carl”
}
]
}

References:
https://github.com/ParsePlatform/parse-server

https://github.com/ParsePlatform/parse-dashboard
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值