天天看點

CentOS 6.9/7安裝Parse+PostgreSQL

一、安裝Parse-Server

# npm install -g parse-server --unsafe-perm      

備注:用--unsafe-perm參數的目的是使用了root權限進行安裝。

二、啟動Parse并測試

// 修改資料庫支援隻用使用者名登入
# vi /var/lib/pgsql/10/data/pg_hba.conf
// 在最後找到這樣host all all 127.0.0.1/32 ident
// 改為host all all 127.0.0.1/32 trust
// 重新讀取配置檔案
# service postgresql-10 reload
// 啟動parse
# parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --restAPIKey RESTAPI_KEY --databaseURI postgres://[email protected]:5432/postgres
// 使用curl測試,正常傳回即可
# curl -X POST -H "X-Parse-Application-Id: APPLICATION_ID" -H "X-Parse-REST-API-Key: RESTAPI_KEY" -H "Content-Type: application/json" -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' http://localhost:1337/parse/classes/GameScore      

備注:資料庫使用的是PostgreSQL

參考:

https://stackoverflow.com/questions/29468404/gyp-warn-eacces-user-root-does-not-have-permission-to-access-the-dev-dir(安裝報錯的解決方法)

https://www.cnblogs.com/jaxu/p/5864134.html(安裝報錯的解決方法)

http://docs.parseplatform.org/parse-server/guide/(官網)

http://docs.parseplatform.org/rest/guide/(官網API)

https://github.com/parse-community/parse-server

繼續閱讀