Pact contracts are easily turned into locally running API stubs. Pact contracts lack advanced features such as predicates that you might find in tools like mountebank, however they are useful for many situations - such as e2e tests with tools like Protractor and Karma.
To get started, from your consumer code base you have a number of ways to run your API stubs outlined below.
Assuming you have a local directory containing your pact files at
See the project page for all available options.
Download the Ruby CLI Tools and install into your
Many of the language implementations will wrap the Ruby CLI Tools which contains the
The location of this will differ across OS and implementation, but is fairly trivial to find, for example, in
pact-js one can do the following to start stubs from
npm run commands.
npm run stubs will start a stub server on port
8080 for the given pact file(s) which you can then use for local development.
See more under "pact-stub-service" on the project page