load Stubs From File
Loads stub definitions from a YAML file at path and registers them with this server.
See loadStubsFromFile for the supported YAML format.
Return
This server instance for chaining.
Parameters
Absolute or relative path to the YAML config file.
Throws
if the file is missing, cannot be read, or contains invalid YAML.
Loads stub definitions from a YAML file and registers them with this server.
Example file:
stubs:
- name: ping
method: GET
path: /ping
response:
body: '{"response":"Pong"}'
status: 200
- name: events
method: POST
path: /sse
response:
type: sse
chunks:
- "One"
- "Two"Supported response types:
plain(default) — static body with optional status, headers, and delaysse— server-sent events stream;chunksare requiredstream— plain chunked stream;chunksare required
Return
This server instance for chaining.
Parameters
YAML config file.
Throws
if the file is missing, cannot be read, contains invalid YAML, or fails semantic validation (unknown method, empty chunks, etc.).