Skip to main content
Version: 4.0.0

Variant handlers directory

Official

Here you have listed the official Variant Handlers included in the Mocks Server main distribution.

  • json: Defines a JSON body and the status code to be sent when the route is requested.
  • text: Defines a text body and the status code to be sent when the route is requested.
  • status: Defines a status code to be sent without body when the route is requested.
  • middleware: Defines an Express middleware to be executed when the request is received. It is completely on your hand to send a response, or to pass the request to the next route, etc.
  • static: Defines a folder from which to serve static assets.
  • file: Defines a file to transfer when the route is requested.
  • proxy: Defines a host to proxy the request when it is received. You can modify the request and/or the response also.

Community

tip

If you have published your own Variant Handler, please modify this page in order to add it, so other users can also take advantage of it 🙂!