boyney123 / mockit

A tool to quickly mock out end points, setup delays and more...
https://mockit.netlify.com/
MIT License
1.58k stars 84 forks source link

delay middleware supports dynamic routes #108

Open patricktran opened 3 years ago

patricktran commented 3 years ago

What:

Enhance delay middleware to support dynamic routes (ie. /my-route/:id)

Adding a delay to dynamic routes does not work as expected

delay/index.js middleware has been modified to include a checkRouteParamsPath method that checks if a dynamic route in routes.json matches the current request. The expectation is that if there is a match and a delay value is set on the route, then the route will respect the delay before returning the response.

Checklist: