Module: controllers/imposterController

The controller that gets and deletes single imposters

Source:

Methods

del(request, response) → {Object}

The function responding to DELETE /imposters/:id

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:
Returns:

A promise for testing

Type
Object

deleteStub(request, response) → {Object}

The function responding to DELETE /imposters/:port/stubs/:stubIndex
Removes a single stub without restarting the imposter

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:
Returns:
  • promise for testing
Type
Object

get(request, response)

The function responding to GET /imposters/:id

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:

postProxyResponse(request, response)

The function responding to POST /imposters/:id/_requests/:proxyResolutionKey
This is what protocol implementations call after proxying a request so
mountebank can record the response and add behaviors to

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:

postRequest(request, response)

The function responding to POST /imposters/:id/_requests
This is what protocol implementations call to send the JSON request
structure to mountebank, which responds with the JSON response structure

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:

postStub(request, response) → {Object}

The function responding to POST /imposters/:port/stubs
Creates a single stub without restarting the imposter

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:
Returns:
  • promise for testing
Type
Object

putStub(request, response) → {Object}

The function responding to PUT /imposters/:id/stubs/:stubIndex
Overwrites a single stub without restarting the imposter

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:
Returns:
  • promise for testing
Type
Object

putStubs(request, response) → {Object}

The function responding to PUT /imposters/:id/stubs
Overwrites the stubs list without restarting the imposter

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:
Returns:
  • promise for testing
Type
Object

resetProxies(request, response) → {Object}

Corresponds to DELETE /imposters/:id/savedProxyResponses
Removes all saved proxy responses

Parameters:
Name Type Description
request Object

the HTTP request

response Object

the HTTP response

Source:
Returns:

A promise for testing

Type
Object

(inner) create(protocols, imposters, logger, allowInjection) → {Object}

Creates the imposter controller

Parameters:
Name Type Description
protocols Object

the protocol implementations supported by mountebank

imposters Object

The map of ports to imposters

logger Object

The logger

allowInjection Boolean

Whether injection is allowed or not

Source:
Returns:
Type
Object