web开发 之 搭建基于Parse数据存储服务

目录

Parse是什么

Parse是BaaS(Backend as a Service)的先驱, 为什么说是先驱呢?

因为Parse在被Facebook收购之后, 于2016年1月已经关闭服务

还好, Facebook作为一个良心企业, 将Parse Server及其相关组件都开源了 [github地址]

对于一些项目来说, Parse Server完全可以满足后端的需求, 且不用写任何一行代码!

现在有哪些主流的BaaS提供商, 国外的Firebase, 国内的代表LeanCloud

准备条件

安装node以及npm

详细参考Node.js官网

安装mongodb

brew install mongodb

启动mongodb服务

mongod --config /usr/local/etc/mongod.conf

安装robomongo

robomongo is a native MongoDB management tool (Admin UI) [这里下载]

parse-server

安装parse-server

npm install -g parse-server

启动parse-server服务

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

验证parse-server服务

curl -X POST \
-H "X-Parse-Application-Id: APPLICATION_ID" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore

如果parse-server启动成功, 上述命令执行的终端输出是

{"objectId":"wuEFLRoaiF","createdAt":"2016-08-31T09:26:57.281Z"}

同时, 我们打开robomongo可以看到一条新数据如下

web-parse_01.png

parse-dashboard

安装parse-dashboard

parse-dashboard is a standalone dashboard for managing your Parse apps

npm install -g parse-dashboard

启动parse-dashboard服务

parse-dashboard --appId APPLICATION_ID --masterKey MASTER_KEY --serverURL "http://localhost:1337/parse" --appName ParseDemo

使用浏览器打开: http://localhost:4040/

web-parse_02.png

接下来, Parse的世界, 就由你自己来探索吧!

更多文章, 请支持我的个人博客

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容