background
Client development, which often need mock
some data. Of course there are many platforms for us to choose. But sometimes we ourselves would like to quickly modify some of the data. Today introduced a more flexible and simple method for quickly mock
some data.
Charles direct useMap local
You can directly use Charles
the Map local
. Using the Local path
function, it will have direct access request data path at your own local configuration json
data, the steps below:
Use Python
to make a simple local service
I was used Python3
.
First, build a folder, folder stored mock
with the json
file cd
to the folder, use the following command to start the server listening 8010
port:
python3 -m http.server 8010
复制代码
Then use Charles
the Map Remote
function, the information filled in the local server, the local data can be used, as shown below:
Reproduced in: https: //juejin.im/post/5cf91c4e6fb9a07ee742d015