Node.js mock server running live, interactive mocks in place of real APIs
unknown
type to options. They support any type and are not validatedroutesHandlers
optioncore.addRoutesHandler
methodcore.loadMocks
methodcore.loadRoutes
methodcore.onChangeMocks
methodcore.onChangeAlerts
methodcore.onChangeLogs
methodcore.restartServer
methodcore.addRouter
methodcore.removeRouter
methodcontext
property from alerts.flat
collection itemscore.alertsApi
getter. Now core.alerts
can be used insteadcore.mocks
gettercore.tracer
gettercore.logs
gettermocks.selected
optionmocks.delay
optioncore.mock.current
settercore.mock.restoreRoutesVariants
methodcore.mock.customRoutesVariants
gettercore.mock.current
gettercore.mock.ids
gettercore.mock.plainMocks
gettercore.mock.plainRoutes
core.mock.plainRoutesVariants
core.mock.error
getteralerts
, config
and logger
properties won’t be available in the core passed to the constructor. If the class has an id getter, those properties will be received in start, stop, init and register methods, but not in the constructor.type
property is mandatory in variantshandler
property in variants, which was an alias for type
. From now, only type
is supported (and required, unless disabled property is true)version
property in variant handlers. From now, all handlers are considered to be defined in “v4” formatplainResponsePreview
getter in variant handlers. Now only preview
getter is supportedrouteVariants
or routesVariants
properties in collections. Now, only routes
is supportedloadMocks
, loadRoutes
, addAlert
, removeAlert
, core
. Now, only the core is passed as argument (with namespaced alerts, logger and config)core.alerts
getter now returns the root Alerts API, not a flat collection of alerts..cjs
filescore.mock.routes.delay
getterAdminApiClient
has to be used instead.@mocks-server/plugin-openapi
to preinstalled plugins.@mocks-server/core
dependency to 3.11.0server.https.enabled
, server.https.cert
and server.https.key
optionshttps
and agent
options to the configClient
methodconfigClient
methodhttps
option to the mocksConfigClient
command and the AdminApiClient
class.MOCKS_SERVER_ADMIN_API_HTTPS
environment variable, allowing to enable https in the default client.@mocks-server/core
dependency to 3.10.0https.enabled
, https.cert
and https.key
optionsserver.https.enabled
option