资讯专栏INFORMATION COLUMN

RESTFeel: 一个企业级的API管理&测试平台。RESTFeel帮助你设计、开发、测试

BlackHole1 / 1008人阅读

摘要:帮助你设计开发测试您的。请求树以树的形式组织请求。合作添加团队成员,管理多个项目。自定义的时间间隔运行项目。标签标签提供了一个有用的方式来组合相关的要求。安全,访问控制,通知机制等。

RESTFeel

RESTFeel: 一个企业级的API管理&测试平台。RESTFeel帮助你设计、开发、测试您的API。

功能简介:

请求生成器-使HTTP请求轻松。

请求树以树的形式组织请求。

合作-添加团队成员,管理多个项目。

PDF报告-生成项目状态报告PDF格式。

历史-查看历史/活动日志。

自定义的时间间隔运行API项目。

SendGrid - SendGrid集成发送通知。

云部署-它可以部署在任何服务器上,也可以用来作为一个基于云的托管Web应用程序。

私人-安装在您的环境和完全拥有它。与你的团队一起在你的私人网络中工作。

数据库-存储在您的数据库中的一切。

swagger API文档生成。

标签-标签提供了一个有用的方式来组合相关的要求。

安全,访问控制,通知机制等。

MongoDB configuration: Building From Source
Prerequisites

JDK 7 or later

Maven 3.0+

Gradle 2.4 (Optional)

MongoDB 3.x

Build
mvn clean install
Run
mvn spring-boot:run
Access

The build file is configured to download and use an embedded Tomcat server. So the application should be up and running by using just two commands mentioned above. Once the server is started, the application can be accessed using http://localhost:8080.

Default login email / password : rf@example.com / rf
Debug
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"

Note : To avoid java.lang.OutOfMemoryError: PermGen space, use the following command:

MAVEN_OPTS="-XX:PermSize=256m -XX:MaxPermSize=512m" mvn spring-boot:run 

Go to src/main/resources/env-development.properties and update mongodb properties. Here is how the sample configuration looks like:

mongodb.name=restfiddle

mongodb.host=localhost

mongodb.port=27017

mongodb.username=

mongodb.password=
Steps to re-build the database:
1. Stop RESTFiddle server, if running.
2. Start MongoDB, if not running.
    Here is the command I use : "C:Program FilesMongoDBinmongod.exe" --dbpath C:UsersANUJADocuments
estfiddledata
3. Connect to MongoDB.
    Here is one of the ways to connect to MongoDB : 
    Go to "C:Program FilesMongoDBin" folder and run "mongo" command.
    Then run "use restfiddle" command and finally "db.dropDatabase()" command to delete the existing RESTFiddle database.
    Note : you will see following message on the command prompt : { "dropped" : "restfiddle", "ok" : 1 }
4. Start RESTFiddle application (mvn spring-boot:run) - This will create and initialize the database.
Steps to recover database:
Sometimes MongoDB doesn"t start and shows message:
        old lock file: C:UsersANUJADocuments
estfiddledatadatamongod.lock. probably means unclean shutdown
Run repair operation to recover your database
    "C:Program FilesMongoDBinmongod.exe" --dbpath C:UsersANUJADocuments
estfiddledatadata --repair
Most likely, your data will be repaired with the --repair option. In case it doesn"t, delete the mongod.lock file and then run the above --repair command.
MongoDB配置数据库用户名密码 Step1.首先,切换到admin db (schema):
> use admin;
switched to db admin
Step2.在該 schema 下面設置用戶名,密碼:
> db.createUser({ user: "root",pwd: "root",customData:{name:"root"},roles:[{ role: "userAdminAnyDatabase",db: "admin" }]})
Successfully added user: {
    "user" : "root",
    "customData" : {
        "name" : "root"
    },
    "roles" : [
        {
            "role" : "userAdminAnyDatabase",
            "db" : "admin"
        }
    ]
}
> db.auth("root","root")
1
Step3.admin中直接给restfiddle权限
var r = 
    {
      "_id": "restfiddle.root",
      "user": "root",
      "db": "restfiddle",
      "credentials": {
        "SCRAM-SHA-1": {
          "iterationCount": 10000,
          "salt": "riZjwBYHvkcV99typ8BRMA==",
          "storedKey": "E2QOruLrBNXD1mlQTX0TQogL/ws=",
          "serverKey": "JEQhfa/5x7+aNzKrFvKRkctXXfQ="
        }
      },
      "roles": [
        {
          "role": "dbOwner",
          "db": "restfiddle"
        },
        {
          "role": "read",
          "db": "restfiddle"
        },
        {
          "role": "readWrite",
          "db": "restfiddle"
        }
      ]
    }


db.system.users.insert(r)

或者

use restfiddle
db.createUser({"user":"jason","pwd":"123456","roles":["dbOwner","read","readWrite"]})

可以看到admin中已经有了jason这个管理员:

> use admin;
> db.system.users.find();

{
  "_id": "restfiddle.jason",
  "user": "jason",
  "db": "restfiddle",
  "credentials": {
    "SCRAM-SHA-1": {
      "iterationCount": 10000,
      "salt": "HZsutqbxGjKVkPcY4305FQ==",
      "storedKey": "bynL9UW9cIf0iPOLo9pGwCFz638=",
      "serverKey": "PRPKH+7dVaKDJ/JE+7ZjQUe3whA="
    }
  },
  "roles": [
    {
      "role": "dbOwner",
      "db": "restfiddle"
    },
    {
      "role": "read",
      "db": "restfiddle"
    },
    {
      "role": "readWrite",
      "db": "restfiddle"
    }
  ]
}

Fetched 4 record(s) in 9ms

參考文章:

《MongoDB极简教程》第一章 安装&环境配置

《MongoDB极简教程》第二章 MongoDB 基本命令

源自开源项目:

RESTFiddle

欢迎关注我的个人空间:

https://jason-chen-2017.githu...

欢迎关注我的个人空间:

https://jason-chen-2017.githu...

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/18978.html

相关文章

  • 优势+工具+实践=DevOps&Docker业级落地

    摘要:的设计模式的设计模式以持续集成持续测试持续交付和持续部署为中心,自动化协作和持续监控是中使用的一些其他设计模式。持续集成持续集成是不断地将源代码集成到一个新的构建或发布的过程,源代码可以在本地存储中,也可以在或中。 showImg(https://segmentfault.com/img/remote/1460000010452455); 识别二维码报名活动 8月19日,来自微软、数人...

    stormjun 评论0 收藏0
  • 2019年微服务实践第一课,网易&谐云&蘑菇街&奥思技术大咖深度分享

    摘要:本次演讲将介绍蘑菇街微服务治理体系经历的架构演进历程,面临的技术难点和解决思路。年加入蘑菇街,目前负责蘑菇街内部中间件平台,包括分布式服务通信框架配置中心服务发现消息队列等其他服务基础设施等项目。文章来源网易云社区 微服务的概念最早由Martin Fowler与James Lewis于2014年共同提出,核心思想是围绕业务能力组织服务,各个微服务可被独立部署,服务间是松耦合的关系,以及...

    genedna 评论0 收藏0
  • 2021年8月国产数据库大事记

    摘要:本文整理了年月国产数据库大事件和重要产品发布消息。柏睿数据库加速安全卡面向全球重磅发布。月日,在全球数字经济大会成果发布会上,中国移动北京分公司与国产数据库领域新锐企业柏睿数据签署战略合作协议。本次大赛主要面向全国爱好数据库的高校学生。 本文整理了2021年8月国产数据库大事件和重要产品发布消息。目录8月国产数据库大事记TOP108月国产数据库大事记时间线产品/版本发布兼容认证8月排行榜新增...

    Scorpion 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<