mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 09:05:54 +03:00
[GH-ISSUE #1836] create if not existing option on map local directory #1829
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1829
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aexvir on GitHub (Nov 1, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1836
Description
when using the map local directory, especially with a wildcard query, I'd like to have an option that would make proxyman create the local json files if they don't exist instead of requesting to the upstream all the time
Why this feature/change is important?
I'm working on a service that on init fetches data from multiple sources, this can sometimes take too much, and I don't want to deal with this stuff when developing, so I'm trying to get proxyman to basically cache those requests on my local filesystem, to always have fast boot when developing, and also so I can edit those payloads every now and then to modify the response
the map local file feature works amazingly for this, but if the url is a bit dynamic the feature is suboptimal, as I either need to manually map every url to its own file, or all of them would reuse the same file
the map local directory feature seems to be the closest to what I want, but there's not an option to create the files if they don't exist, and I can't really create them manually because of the same reason mentioned earlier
I tried to achieve this using scripting but I don't think I can, because the available hooks only allow me to modify the request or the response, but if I modify the response, the request would have already happened, which defeats the purpose of this (please correct me if I'm wrong, I might have not understood this correctly)
@NghiaTranUIT commented on GitHub (Nov 1, 2023):
You can simply do it by following this steps:
@aexvir commented on GitHub (Nov 1, 2023):
yes, I know this, but these requests have dynamic stuff on the url, so I'd need to do this all the time, adding new mappings for every new request url