3.0.0 • Published 6 years ago

frock-middleware-delay v3.0.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

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.