#Poser


#registerService

Register a new service:

poser.registerService(serviceKey, serviceMock);

#Arguments

NameTypeDescription
serviceKeystringA unique key for the service. This key will be used in the service's URL: http://localhost:1000/<serviceKey>
serviceMockServiceMockThe 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

NameTypeDescription
serviceKeystringThe key identififying the service to extend
serviceMockServiceMockExtensionThe ServiceMockExtension object. See the docs

#start

Start the server:

poser.start(port);

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

#Arguments

NameTypeDescription
portnumberOptional: port to start the server. Default: 1000

#reset

This method will reset all services (clear store).

poser.reset(serviceKey);

#Arguments

NameTypeDescription
serviceKeystringOptional: specify which service to reset. No argument means reset all services.

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