Skip to content

Lupa API Reference / network/types / RouteDefinition

Interface: RouteDefinition ​

Defined in: src/network/types.ts:153

Internal representation of an active mock route within the RouteStore.

Properties ​

headers? ​

optional headers?: Record<string, string>

Defined in: src/network/types.ts:172

Normalized headers required for a successful match.


id ​

id: number

Defined in: src/network/types.ts:157

Unique identifier of the registered mock.


lifetime? ​

optional lifetime?: number

Defined in: src/network/types.ts:182

Maximum number of times this mock should be applied.


methods? ​

optional methods?: string[]

Defined in: src/network/types.ts:167

Normalized HTTP methods to match.


pattern? ​

optional pattern?: URLPattern

Defined in: src/network/types.ts:162

Compiled URLPattern for matching request URLs.


query? ​

optional query?: Record<string, string | string[]>

Defined in: src/network/types.ts:177

Declarative query parameter key-value pairs to match against parsed URL parameters.


usageCount ​

usageCount: number

Defined in: src/network/types.ts:187

Number of times this mock has been successfully matched.