Skip to main content

Module config

Module config 

Source
Expand description

Domain models and YAML configuration loading.

This module defines the shape of a mockd configuration file:

listen: ":8080"
routes:
  - method: GET
    path: /users/{id}
    when:
      query:
        role: admin
    response:
      status: 200
      body:
        id: "{{path.id}}"

Structs§

Config
Top-level configuration file.
RequestMatch
Rules used to decide whether a Route matches an incoming request.
ResponseConfig
How a matched request should be answered.
Route
A single mock route.
UnknownMethodError
Error returned when a method string cannot be parsed.

Enums§

ConfigError
Errors that can occur while loading a configuration.
Method
Supported HTTP methods.
ResponseSpec
Either a single response or an ordered sequence of responses.