需要先安装:
node:https://nodejs.org/en/download/
https://docs.mongodb.com/manual/reference/program/mongod/mongodb:
parse server 官网:http://parseplatform.org/
后台源码下载地址:https://github.com/ParsePlatform/parse-server
web后台管理下载地址:https://github.com/ParsePlatform/parse-dashboard
先启动mongodb
下载后进入parse-server目录:
1,打开命令客户端,运行命令:npm install
2,新建config.json
{
"appId": "123123",
"masterKey": "qweqwe",
"restAPIKey":"123123",
"javascriptKey":"123123",
"appName": "gemo",
"cloud": "./cloud/main",
"databaseURI": "mongodb://127.0.0.1:27017/parse"
}
cloud目录自己定义
3,运行项目:npm start config.json
在项目目录下
1,执行:npm install , 安装运行模块
2,新建文件config.json
{
"apps": [
{
"serverURL": "http:/ip:1337/parse",
"appId": "123123",
"masterKey": "qweqwe",
"restAPIKey":"123123",
"javascriptKey":"123123",
"appName": "parse"
}
],
"users": [
{
"user":"gemoapp",
"pass":"123123"
},
{
"user":"user2",
"pass":"pass"
}
]
}
users为parse-dashboard登录账号
相同key的value值需要对应parse-server的配置文件值
3,运行:npm run start
后台运行项目
安装模块:npm install -g pm2
使用pm2 运行后台:
pm2 start config.json
pm2 运行dashboard:
#parse-dashboard目录下执行以下命令:
parse-dashboard --config config.json --allowInsecureHTTP=1
新建production.json
{
"apps" : [{
"name" : "dashboard",
"script" : "./start.sh",
"watch" : true,
"min_uptime": "60s",
"max_restarts": 30
}]
}
运行命令:pm2 start production.json