Configuration

Stubr is being configured by providing a configuration object to the constructor. The configuration is optional since Stubr assumes sensible default values.

Configuration Options

PropertyTypeDefault Value
stubsPortnumber4000
uiPortnumber3000
corsEnabledbooleantrue
corsAllowOriginstring*

CORS Handling

By default, Stubr has CORS handling enabled. As such it answers incoming OPTIONS requests by providing CORS headers with wildcard values (i.e. *).
You can modify that behaviour by either limiting allowance to only the provided domain (i.e. by setting a value to corsAllowOrigin configuration) or disabling CORS treatment entirely (i.e. by setting corsEnabled to false).

Example

const stubr = new Stubr({
    stubsPort: 4001,
    uiPort: 3001,
  	corsAllowOrigin: "example.com"
});

What’s Next

Move on with registration of your scenarios