前段时间为了解决前端对接口的测试的问题,在网上搜索了很多的解决方案,最终吸引个人是一个名为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
进入交互式界面。