V – is the Mock

V-mock is designed to make it very, very easy for developers to build a simple interface Mock server locally, input the URL of the interface you want to emulate, and the data returned by that URL in JSON or XML or whatever format, and start calling. Project address: gitee.com/vtDev/v-moc… Github:github.com/i-am-vt/v-m…

What situation should I Mock, and why should I repeat the wheel, or a little wheel?

  • The front and back ends are connected. The back end has not been developed yet.
  • The third party cannot provide a test environment.
  • Require the Mock function to pollute code “0”
  • Company data security is strict /Mock data cannot be hosted to third parties/Intranet development etc.
  • Think similar high-end software functions are too much to use/not easy to deploy 😀

What are the features of V-Mock

  • Any request type is supported, including Path parameter requests.
  • Supports custom response headers, HTTP status code, and return bodies. (However, it is not recommended to mess with the HTTP code, for example, some browsers receive a return status of 789, may suspend the request)
  • Provide detailed [request body detail] and [response body detail] logs for each call success, request header.. Parameter.. Header.. Cookies can be found.
  • Support to create a variety of return formats, one key switch. Ps: It is not supported to switch the return format according to the logic of the request parameters. Only one key can switch the return body in the background, but this advantage is convenient for developers to test.
  • Sqlite embedded database, users do not need to care about database matters, can be treated as no database.

How to install

How to install

For use only, we only need JRE and do not need any other software. Do not clone source code!! Go to the Releases page (which is slow to access using the code cloud) and download the latest version of the JAR package

By default, port 80 can be append –server.port= XXX as you specify

java -jar v-mock.jar
Copy the code

Port = XXX –server. Port = XXX

How to use

After the installation is complete, access the V-Mock background interface based on your IP address and specified port. Log in using the administrator account: vmock/vmock123

After logging in successfully, you can configure the Mock URL in the Interface Overview module.

Pay attention to

The default Context Path of all Mock urls is /vmock. If /v1/test is configured, the request is received by HTTP (s):// IP :prot/vmock/v1/test. You need to add /vmock

Many users

The administrator can modify the Invitation code in the system parameters, so that common users can register with the system by using the invitation code.

permissions

The permission design is very simple:

  • Administrator: You can see two modules of system Parameters and User Management.
  • Common users: can use the interface Overview and Interface Log modules.
  • Not logged in: You can call the Mock interface configured in the system under/vMock.

Part of screenshot display

Log in to register






At the end

For the first time open source, we welcome your comments, bugs and code specifications, comments and suggestions, etc. Welcome your comments! I will give feedback in time! Thank you very much!