Skip to content

Commit

Permalink
update README and add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
u4aew committed Apr 29, 2024
1 parent 5d14b44 commit 9e2432d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# HTTP Spider
![Plugin Interface](img/logo.png)
## Description
This project is a Chrome plugin that serves as a tool for creating HTTP mocks for Mocker API. It records HTTP requests made by the user and exports them into mock.js format for easy integration with Mocker API.
This project is a Chrome plugin that serves as a tool for creating HTTP mocks for Mocker API. It records HTTP requests made by the user and exports them into mock.js format for easy integration with [Mocker API](https://github.com/jaywcjlove/mocker-api).

## Installation
To install the plugin, follow these steps:
Expand Down
36 changes: 36 additions & 0 deletions demo/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const proxy = {
_proxy: {
proxy: {},
pathRewrite: {},
changeHost: true,
// modify the http-proxy options
httpProxy: {
options: {
ignorePath: true,
},
listeners: {
proxyReq: function () {
console.log('proxyReq');
},
},
},
},
'/api/user': {
id: 1,
username: 'kenny',
sex: 6,
},
'GET /api/user/list': [
{
id: 1,
username: 'kenny',
sex: 6,
},
{
id: 2,
username: 'kenny',
sex: 6,
},
],
};
module.exports = proxy;

0 comments on commit 9e2432d

Please sign in to comment.