bahmutov/connect-slow — pull request #2 by jwhitfieldseed (2014-10-29 09:51:37+00:00)
Title: Add query parameter delay

As discussed in #1. I am opening the PR before updating the docs so you can check through what I have done :-) When you are happy I can update the README as another commit on this PR.

It's worth discussing how the `url` and `delayQueryParam` options interact. This PR gives priority to `delayQueryParam` - that is, with these options:

````javascript
{
url: /\.slow$/,
delayQueryParam: 'delay',
delay: 500
}
````

We will see the following behaviour:

`/foo` - no delay
`/foo.slow` - delay by 500ms
`/foo?delay=1000` - delay by 1000ms
`/foo.slow?delay=1000` - delay by 1000s

I think this is the right behaviour, because the query param can be seen as a request-time override of the default options, but it would be good to get your thoughts.