介绍
fekit是qunar前端组推出的 : 强大的前端开发工具.
解决以下问题:
- 本地开发调试环境的支持
- 组织多文件/多组件之前的依赖问题
- 模块化解决方案
- 自动化合并/混淆源码
- 自动化单元测试
使用
本地调试
进入代码目录
fekit server
mock接口
通过读取配置进行不同的接口mock
fekit server -m mock.js
配置文件如下
module.exports = {
"/exact/match/1": "exact.json",
"/exact/match/2": "exact.mockjson",
"/exact/match/3": "https://raw.githubusercontent.com/rinh/fekit/master/docs/mock/exact.json",
"/exact/match/4": "exact.js",
rules: [{
pattern: "/exact/match/5",
respondwith: "exact.json"
}, {
pattern: /^\/regex\/match\/a\/\d+/,
respondwith: "regex.json",
jsonp: "__jscallback"
}, {
pattern: /^\/regex\/match\/b\/\d+/,
respondwith: function(req, res, context) {
res.end(JSON.stringify(Object.keys(context)));
}
}]
};