UNPKG

handle-mock

Version:

An express middleWare function to control request forward,if the request match the config, it will return the mock data,otherwise the reauet will forward to the target host

9 lines (8 loc) 195 B
interface config { url: string, params?: object, mockData: object, target?: string } declare function handleMock(config: config[], defaultHost: string): any; export = handleMock;