在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:chinesedfan/parrot-mocker-web开源软件地址:https://github.com/chinesedfan/parrot-mocker-web开源编程语言:JavaScript 76.1%开源软件介绍:parrot-mocker-webThis project provides a simple mock server, which works with the Chrome plugin parrot-mocker. Support:
Not support:
How to use1.PrepareInstall Chrome plugin, parrot-mocker, so that your pages have the ablity to intercept requests and forward to this mock server. Other usages without the plugin can refer to parrot-mocker project. 2.VisitFor example, if deployed in leancloud, please open your Chrome browser and visit index page first. Other instances like now.sh are similar. Then visit your test page, i.e. my demo, which will send 3 different requests(xhr/jsonp/fetch) after loaded. In the plugin, input the mock server address and click the green button. The test page will reload automatically. Now you will find that requests are forwarded to the mock server, which are also visiable at index page. If visiting other pages in the same domain, their requests will also be forwarded to this mock server. 3.MockClick any request in the list, and click 'Add'. Then this request is added to mock. Open config page, now you can edit the mock data. Remember to click 'Apply' to really use the mock data. Refresh your test page to check whether the mock is working correctly. Launch locallyBy default, the server is launched on main port 8080, and sub-ports 8442/8443. Sub-ports can be visited by http/https correspondingly. Because my https is self-certified, if your browser gives a warning, please continue to visit. node ./server/index.js Or you can specify the port by an environment variable. PORT=8888 HTTP_PORT=9442 HTTPS_PORT=9443 node ./server/index.js To use local server, you should visit and set local address as mock server in step 2, i.e. Tips
LicenseAcknowledgement
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论