qcobjects-handler-mockup

0.0.17 • Public • Published

QCObjects Handler for Mockup Backend Services

QCObjects Handler for Mockup requests. This handler will allow to handle Mockup urls like https://example.com/rest/mockup and get a fake or dummy response in JSON format

Instructions

  1. Install this dependency in your project using npm
npm i --save qcobjects-handler-mockup
  1. In your config.json file, create the following paths
{
  "backend": {
    "routes": [
      {
        "name": "Mockup Url",
        "description": "Get a fake JSON response from a mockup url",
        "path": "^/rest/mockup$",
        "microservice": "com.qcobjects.backend.microservice.mockup",
        "supported_methods": ["POST"],
        "responseHeaders": {
          "Content-Type": "application/json"
        },
        "response": {
          "access_token": "a1b2c3d4e5",
          "expires_in": 3600,
          "token_type": "Bearer"
        }
      }
    ]
  }
}

The contents of response is a dynamic object, you can specify any property here or even use a meta processor.

  1. Start the QCObjects HTTP2 Server
qcobjects-server
  1. Visit https://example.com/openapi.json to view the result

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.17
    0
    • latest

Version History

Package Sidebar

Install

npm i qcobjects-handler-mockup

Weekly Downloads

0

Version

0.0.17

License

LGPL-3.0-or-later

Unpacked Size

18.8 kB

Total Files

13

Last publish

Collaborators

  • jeanmachuca