frock-middleware-delay

3.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i frock-middleware-delay

Weekly Downloads

1

Version

3.0.0

License

Apache-2.0

Unpacked Size

9.15 kB

Total Files

8

Last publish

Collaborators

  • fardog
  • ua