實際環境的需求能夠說是:只有你沒想到,沒有實現不了的html
徵對於目前實際開發、測試、生產等環境中,須要用到各種的接口可達幾10、甚至上百個,所以,必須須要一個統一管理的工具平臺來統一管理這類接口,從而方便後續使用。node
那麼今天來簡單介紹下開源的接口管理工具:YApic++
官方網站:https://yapi.ymfe.org/index.htmlgit
Github地址:https://github.com/YMFE/yapigithub
YApi 是高效、易用、功能強大的 api 管理平臺,旨在爲開發、產品、測試人員提供更優雅的接口管理服務。能夠幫助開發者輕鬆建立、發佈、維護 API,YApi 還爲用戶提供了優秀的交互體驗,開發人員只需利用平臺提供的接口數據寫入工具以及簡單的點擊操做就能夠實現接口的管理。mongodb
特性shell
環境要求(centos安裝環境)數據庫
nodejs(7.6+)npm
mongodb(2.6+)json
安裝 Node.js
[root@tools-server ~]# curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
[root@tools-server ~]# yum -y install nodejs [root@tools-server ~]# yum install gcc-c++ make -y
安裝配置MogoDB數據庫
[root@tools-server ~]# cd /etc/yum.repos.d/ [root@tools-server yum.repos.d]# vim mongodb.repo [mongodb] name=MongoDB Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ gpgcheck=0 enabled=1 [root@tools-server ~]# yum install mongodb-org -y
啓動服務
[root@tools-server ~]# service mongod start Starting mongod (via systemctl): [ 肯定 ] [root@tools-server ~]# ps -ef|grep mongod mongod 10549 1 0 11:00 ? 00:00:00 /usr/bin/mongod -f /etc/mongod.conf root 10563 1291 0 11:00 pts/0 00:00:00 grep --color=auto mongod [root@tools-server ~]# lsof -i :27017 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mongod 10549 mongod 8uIPv4 28721 0t0 TCP localhost:27017 (LISTEN)
建立數據庫
[root@tools-server ~]# mongo MongoDB shell version: 2.6.12 connecting to: test Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user > use yapi switched to db yapi > db.wong.insert({"name":"kenny wong"}) WriteResult({ "nInserted" : 1 }) > show dbs admin (empty) local 0.078GB yapi 0.078GB > db.addUser('yapi','yapi321') WARNING: The 'addUser' shell helper is DEPRECATED. Please use 'createUser' instead Successfully added user: { "user" : "yapi", "roles" : [ "dbOwner" ] }
安裝yapi軟件
[root@tools-server ~]# mkdir yapi [root@tools-server ~]# cd yapi/ [root@tools-server yapi]# git clone https://github.com/YMFE/yapi.git vendors
若是下載較慢,可直接下載壓縮包進行解壓
[root@tools-server yapi-master]# cp config_example.json ../config.json
[root@tools-server yapi-master]# vim config.json { "port": "3000", "adminAccount": "admin@admin.com", "db": { "servername": "127.0.0.1", "DATABASE": "yapi", "port": 27017, "user": "yapi", "pass": "yapi321" }, "mail": { "enable": true, "host": "smtp.163.com", "port": 465, "from": "***@163.com", "auth": { "user": "***@163.com", "pass": "*****" } } }
[root@tools-server yapi-master]# npm install --production --registry https://registry.npm.taobao.org
啓動服務
WEB登錄
具體一些後面接口與項目操做,能夠參考官方文檔