# Poser


# registerService

Register a new service:

poser.registerService(serviceKey, serviceMock);

# Arguments

Name Type Description
serviceKey string A unique key for the service. This key will be used in the service's URL: http://localhost:1000/<serviceKey>
serviceMock ServiceMock The ServiceMock object to register. See the docs

# extendService

Extend an existing service:

poser.extendService(serviceKey, serviceMock);

This method must be called after a registerService for the same serviceKey.

# Arguments

Name Type Description
serviceKey string The key identififying the service to extend
serviceMock ServiceMockExtension The ServiceMockExtension object. See the docs

# start

Start the server:

poser.start(port);

This method must be called last, after registering/extending services.

# Arguments

Name Type Description
port number Optional: port to start the server. Default: 1000

# reset

This method will reset all services (clear store).

poser.reset(serviceKey);

# Arguments

Name Type Description
serviceKey string Optional: specify which service to reset. No argument means reset all services.

Poser can also be reset by calling http://localhost:1000/_reset.