MockConfig
Defined in: packages/gateway/src/policies/mock.ts:10
Configuration for the mock policy.
Extends
Section titled “Extends”Properties
Section titled “Properties”allowInProduction?
Section titled “allowInProduction?”
optionalallowInProduction?:boolean
Defined in: packages/gateway/src/policies/mock.ts:20
When true, suppress the production usage warning. Default: false.
optionalbody?:string|Record<string,unknown>
Defined in: packages/gateway/src/policies/mock.ts:14
Response body. Can be a string or object (will be JSON-serialized).
delayMs?
Section titled “delayMs?”
optionaldelayMs?:number
Defined in: packages/gateway/src/policies/mock.ts:18
Artificial delay in milliseconds. Default: 0.
headers?
Section titled “headers?”
optionalheaders?:Record<string,string>
Defined in: packages/gateway/src/policies/mock.ts:16
Response headers.
optionalskip?: (c) =>boolean|Promise<boolean>
Defined in: packages/gateway/src/policies/types.ts:90
Skip this policy when condition returns true
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean | Promise<boolean>
Inherited from
Section titled “Inherited from”status?
Section titled “status?”
optionalstatus?:number
Defined in: packages/gateway/src/policies/mock.ts:12
HTTP status code to return. Default: 200.