Skip to content

02.3 Configuration

Amit Gupta edited this page Jan 4, 2019 · 2 revisions

Although Stubmatic can build configuration on the basis of directory structure, or on the basis of CLI arguments, a config file can help you to do more settings like default mapping, mappings to skip etc. It helps to customize the project structure and reduce mappings.

Sample

{
  "dbsets": "dbsets/",
  "mappings": {
    "default": {
      "request": {
        "method": "GET"
      },
      "response": {
        "strategy": "first-found",
        "latency": 0,
        "status": 200
      }
    },
    "requests": ["mappings/response.yaml", "mappings/strategy.yaml", "mappings/post.yaml", "mappings/dbset.yaml", "mappings/dbset2.yaml"]
  },
  "server": {
    "port": 9999,
    "securePort": 8000
  },
  "stubs": "stubs/",
  "logs": {
    "path": "logs/"
  },
  "dumps": "dumps/"
}
Clone this wiki locally