Skip to content

Load config as a JS file only. Allow dynamic logic/options #34

@ballercat

Description

@ballercat

Fully switch over to using the config as a loaded js module. Add some dynamic option support, the two main features are listed below.

cache.hashFunction(request, defaultHashFunction) -> Promise<hash>

Let the user define a custom hash function. Very useful for certain type of requests. The resulting hash is used throughout for identifying the cached record (like filenames, ids). A user could for example always return the same hash value if desired for certain type of requests which maintain dynamic parameters but don't influence the response. A custom hash value can also make artifacts easily identifiable.

The hash function will always be preferred over defaultHashFunction.

stub: (request) -> Promise<response>

Let the user define custom stubs via a function. The glob matching might be too difficult.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions