Delay middleware for frock. Introduce some latency.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
tests
.gitignore
.npmignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
package-lock.json
package.json

README.md

frock-middleware-delay

A frock middleware for introducing latency into a request.

frockfile Example

In your working directory, create a frockfile.js:

{
  "servers": [
    {
      "port": 8080,
      "routes": [
        {
          "path": "/api/people",
          "methods": ["GET"],
          "handler": "frock-static",
          "middleware": [
            {
              "handler": "frock-middleware-delay",
              "options": {
                "min": 300,
                "max": 1500
              }
            }
          ],
          "options": {
            "file": "fixtures/static/people.json",
            "contentType": "application/json"
          }
        }
      ]
    }
  ]
}

License

Apache 2.0, see LICENSE for details.