Giter VIP home page Giter VIP logo

grunt-restful-mock's Introduction

logo.svg

模拟 AJAX 请求返回的 JSON 数据,减少前端工程师对后端接口的依赖,在接口规范的基础之上并行开发。

MIT License npm:

特性

  • 基于数据模板生成随机数据
  • 自定义数据模板占位符
  • 支持 restful 接口
  • 支持 JSONP 请求
  • 模拟 HTTPOnly 的 Cookie
  • 模拟 HTTP 响应状态码,模拟请求超时,模拟网络延时
  • 热重启,修改 mock 配置后自动重启服务

使用

相关模块

历史

v0.2.1

  • 添加 logo.svg
  • 更新文档

v0.2.0

  • 重构,提取核心代码为独立的模块

v0.1.21

  • 增加自定义占位符接口
  • 组合谓词(get|post),参数修饰谓词(get[param1=value1]

grunt-restful-mock's People

Contributors

bubkoo avatar maxjchuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-restful-mock's Issues

watch监听文件变化无效

module.exports = function (grunt) {
grunt.initConfig({
mock: {
options: {
port:'3001',
host:'localhost',
debug: true,
watch: ['./mock/.json'],
},
api:{
// 这里配置 route 所在的文件
cwd: 'mock',
// 路由配置文件
src: ['
.json']
}

    }
});
grunt.loadNpmTasks('grunt-restful-mock');
grunt.registerTask('default', ['mock']);

}

此插件是单线程的吗?

如果同时访问,需要等待前一个接口输出结果后才请求第二个接口,请问是否支持多线程

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.