Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bubkoo/grunt-restful-mock
🚀 A mock server returning random JSON-data.
https://github.com/bubkoo/grunt-restful-mock
api json mock restful
Last synced: 23 days ago
JSON representation
🚀 A mock server returning random JSON-data.
- Host: GitHub
- URL: https://github.com/bubkoo/grunt-restful-mock
- Owner: bubkoo
- License: mit
- Created: 2014-05-22T18:10:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-17T17:58:10.000Z (over 8 years ago)
- Last Synced: 2024-10-03T12:24:25.824Z (about 1 month ago)
- Topics: api, json, mock, restful
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/grunt-restful-mock
- Size: 435 KB
- Stars: 42
- Watchers: 7
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![logo.svg](https://cdn.rawgit.com/bubkoo/grunt-restful-mock/master/logo.svg)
> 模拟 AJAX 请求返回的 JSON 数据,减少前端工程师对后端接口的依赖,在接口规范的基础之上并行开发。
[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/bubkoo/grunt-restful-mock/blob/master/LICENSE)
[![npm:](https://img.shields.io/npm/v/grunt-restful-mock.svg?style=flat-square)](https://www.npmjs.com/packages/grunt-restful-mock)## 特性
- 基于数据模板生成随机数据
- 自定义数据模板占位符
- 支持 restful 接口
- 支持 JSONP 请求
- 模拟 HTTPOnly 的 Cookie
- 模拟 HTTP 响应状态码,模拟请求超时,模拟网络延时
- 热重启,修改 mock 配置后自动重启服务## 使用
- [开始使用](https://github.com/bubkoo/grunt-restful-mock/wiki/开始使用)
- [使用示例](https://github.com/bubkoo/grunt-restful-mock/wiki/使用示例)
- [数据模板语法规则](https://github.com/bubkoo/grunt-restful-mock/wiki/数据模板语法规则)
- [内置占位符](https://github.com/bubkoo/grunt-restful-mock/wiki/内置占位符)## 相关模块
- [restful-mock-server](https://github.com/bubkoo/restful-mock-server)
- [generate-random-data](https://github.com/bubkoo/generate-random-data)
- [json-from-template](https://github.com/bubkoo/json-from-template)## 历史
### v0.2.1
- 添加 `logo.svg`
- 更新文档### v0.2.0
- 重构,提取核心代码为独立的模块### v0.1.21
- 增加自定义占位符接口
- 组合谓词(`get|post`),参数修饰谓词(`get[param1=value1]`)