Editare

Partajați prin


Change mocks file

At a glance
Goal: Specify a custom mocks file for the MockResponsePlugin
Time: 3 minutes
Plugins: MockResponsePlugin, GraphMockResponsePlugin
Prerequisites: Set up Dev Proxy

By default, the MockResponsePlugin and GraphMockResponsePlugin Dev Proxy plugins looks for a file called mocks.json in the current working directory.

To use a file with a different name, use:

devproxy --mocks-file my-mocks.json

Alternatively, you can specify the mocks file in the devproxyrc.json configuration file.

File: devproxyrc.json

{
  "mocksPlugin": {
    "mocksFile": "mocks.json"
  }
}

Learn more about the MockResponsePlugin.

See also