Git Product home page Git Product logo

mock's Introduction

mock工具

该工具可以模拟本地的http服务后端接口,以方便前端联调接口,支持多种请求类型,自定义url和参数。针对由socket.io和websocket的推送服务进行的不同的支持。 socket.io的服务直接基于当前的http服务,websocket服务要设置不同的端口号。调用方式与官方接口一致。

新版icestar工具下载 MOCK工具(64位)下载地址: https://raw.githubusercontent.com/tianxiangbing/mock/download/mock.exe MOCK工具(32位)下载地址: https://raw.githubusercontent.com/tianxiangbing/mock/download/mock-32.exe

功能预览

源码地址:https://github.com/tianxiangbing/mock

使用方法

  1. 新增接口

2. 输入接口必要信息,添加进配置文件

3. 返回至主界面,启动服务

  1. 查看已有接口界面可以对现有接口进行编辑和删除

  1. 每一次接口和添加或修改,必须重启服务才会生效

  2. 主界面的json格式验证,提供一个快捷的json格式验证和格式化工具.

  1. Socket.io推送消息如上面步骤类似,需要先启用http服务

    socket = io.connect('http://localhost:8080'); socket.emit('message', '测试成功!'); socket.on('message', function (data) { $('#sctips').html(data); });

  2. websocket推送消息不同于socket.io,需要单独设立端口号

    const ws = new WebSocket('ws://localhost:8090/ws'); ws.on('message', function incoming(data) { $('#wstips').html(data) });

  3. 新增本地目录建站点

    选择本地文件夹目录,指定端口号,即可开启本地的http静态资源映射。http://localhost:8000

  4. 新增md5文件加密

  5. 新增修改exe的icon图标

  6. 接口文档快速转换成json格式

mock's People

Contributors

tianxiangbing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.