mockyeah

A powerful service mocking, recording, and playback utility.

Notice: These docs are for mockyeah 1.x & above. For legacy mockyeah 0.x, please see https://mockyeah.github.io/mockyeah/.

Server API @mockyeah/server

The default export of mockyeah is an instance of this class.

So it has all the "Mock API" methods described previously as mockyeah.*, such as get, post, record, reset, etc.

It also has a url properly which is the root URL of the server, which is handy when using dynamic port: 0 in configuration, for example, in unit tests.

Use it to programmatically construct your own instance of mockyeah, perhaps with dynamic configuration.

First import it:

import Server from '@mockyeah/server/server';

const mockyeah = new Server({
  // ...configuration options
});

For configuration options, see Configuration.


© 2020 mockyeah, Built with Gatsby