Skip to content

JackyTianer/yapi-mock-proxy-plugin

Repository files navigation

yapi-mock-plugin

Screenshot

image.png

image.png

Features

  • Interface forwarding can be implemented without modifying the code
  • Automatic synchronization from the yapi, no need to write the interface again
  • Turn on/off at any time

Install

Download

You can download the source code and build it yourself, or download the built version from following links:

Chrome Webstore

You can download crx file in chrome webstore; link

How to use

  • After you install the plugin, click the settings button in the popup
  • Input your server address like https://yapi.test-host.net/
  • Find you project token at yapi, you can find it at the token configuration in the project image.png
  • Click the add project button and input you token on it
  • Click the Sync Now button, and when the popup prompts success, you will be happy to mock.

Run and Build

Environment

  • Install Node.js
  • Change to the folder ./, run npm install to install dependented libraries
    npm install

Run

  • Change to the folder ./, run npm run chrome-watch to watch files change(If you use Firefox or another browser, run npm run firefox-watch)
  • Open Chrome/Opera browser and navigate to chrome://extensions
  • Select "Developer Mode" and then click "Load unpacked extension..."
  • From the file browser, choose to YAPI-mock-plugin/build/chrome or (YAPI-mock-plugin/build/opera)

Developing

The following tasks can be used when you want to start developing the extension and want to enable live reload -

  • npm run chrome-watch
  • npm run opera-watch
  • npm run firefox-watch

Packaging

Run npm run dist to create a zipped, production-ready extension for each browser. You can then upload that to the appstore.

Copyright

This project is licensed under the MIT license.


If you have any questions or comments, please create a new issue. I'd be happy to hear your thoughts.

About

Easy to intercept the ajax/fetch request defined on YAPI (简单的YAPI mock插件,开启后,自动将请求转发给yapi服务器,获取mock数据)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published