Nei Chrome插件
前端工程师在开发页面的时候,经常会碰到一个很实际的问题: 在后端接口还没开发完成时,前端怎么办?
通常有两种方案:
1. 直接在代码中 mock 相应的数据。这种方案的缺点很明显,会引入无用的代码。
2. 请求转发,利用nginx或者本地server(webpack-serve)将本地开会过程中调用的接口转发到nei线上服务。
方案二 看似完美,但是在实际使用过程中有配置成本层面的问题:
1. 接口变更(新增、删除、修改)都需要更新转发路由表的配置文件
2. 接口开始和关闭mock服务,配置比较繁琐,不够直观
3. webpack-serve方式代理,在多人协助时git冲突不可避免
基于目前开发阶段前端工程师大多使用chrome调试的现状,将方案二中请求转发的逻辑迁移到浏览器中处理,并提供开启关闭接口mock的交互界面。
Extore is a team of professionals who are passionate about creating extensions for web browsers. This devotion also gives us opportunity to appreciate work of other people. We get inspired by useful, open source extensions made by developers all over the world. Our strong belief is that one should share helpful add-ons with others. That’s why we’d like to present you our ever-growing list of favourite extensions that have inspired us. Moreover, as you probably have already learned, sometimes struggling for the best brings an end to the good. Talking about add-ons it often turns out that an upgrade is worse then previous version. Also it can become really tricky to get back to the beloved version of your favourite extension. That’s why we’re going to make not only the latest, but all versions of our favourite (and we hope yours too) add-ons available for download. No more compromises, just stick to the version you really like!