Skip to content

create if not existing option on map local directory #1836

@aexvir

Description

@aexvir

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions