有没有办法使用 map local 和 Charles 为目录提供服务?

Is there a way to serve a directory using map local and Charles?

我有以下形式的网络请求:

http://www.blahblah.com/folder/version/dist

我想在 Charles 的“映射本地”选项中添加一条规则,以便提供如下所示的目录:

Users/me/Documents/code/project/dist

两个 dist 文件夹的文件结构相同。我当前的请求规则是:http://www.blahblah.com/folder/*/dist,我要求它在其位置提供 Users/me/Documents/code/project/dist,但是,文件仍然来自原始请求的资源。

有没有办法代理整个目录?

根据 CharlesProxy documentation:

中的说明,您应该可以这样做

If you are testing css, swf or image changes you can map those file types to your local development copy of the website so you can browse the live site with all your development assets. Create a mapping from live.com/*.css to the root of your local development copy, and similar mappings for the other file types. Alternatively you can map whole directories or individual files as required.

我想您的问题可能出在您尝试映射的路径上。我会说你需要在你的路径末尾添加一个星号,比如:

http://www.blahblah.com/folder/*/dist/*

您可以尝试添加 .css,如示例

http://www.blahblah.com/folder/*/dist/*.css