前段時間爲了解決前端對接口的測試的問題,在網上搜索了很多的解決方案,最終吸引個人是一個名爲Yapi的工具。好傢伙,看文檔介紹的功能都很知足個人需求,擼起文檔就是幹。等等,官方文檔說這個項目依賴於Mongodb,那好吧,環境仍是得配起來的,因而便有了下文。html
dbpath = D:\MongoDB\Server\3.4\data\db
logpath = D:\MongoDB\Server\3.4\log\mongodb.log
logappend = true
directoryperdb = true
serviceName = MongoDBService
serviceDisplayName = MongoDBService
port = 27017
複製代碼
dbpath:數據庫數據存儲路徑;logpath:log日誌存儲路徑;logappend:是否追加記錄;serviceName:註冊的系統服務名;serviceDisplayName:用於顯示的系統服務名;port:mongodb的對外端口。前端
windows+x
,選擇windows powershell(管理員),進入shell面板,輸入cd D:\MongoDB\Server\3.4\bin
進入mongodb.exe所在的目錄,執行./mongodb.exe -install -f "D:\MongoDB\Server\3.4\mongo.conf"
。2019-08-22T11:00:47.441+0800 I CONTROL [main] Trying to install Windows service 'MongoDBService'
2019-08-22T11:00:47.443+0800 I CONTROL [main] Service 'MongoDBService' (MongoDBService) installed with command line 'D:\MongoDB\Server\3.4\bin\mongod.exe -f D:\MongoDB\Server\3.4\mongo.conf --service'
2019-08-22T11:00:47.443+0800 I CONTROL [main] Service can be started from the command line with 'net start MongoDBService'
複製代碼
net start MongoDBService
複製代碼
net stop MongoDBService
複製代碼
mongod.exe --remove --serviceName "MongoDB"
複製代碼
./mongo.exe
進入交互式界面。