Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
basic_auth Revert "Update documentation for basic auth." May 5, 2017
Gemfile chore: remove saas code Mar 7, 2018
README.md chore: update example Jun 2, 2018
config.ru
example_data.sql chore: update example_data.sql with matrix refresh Apr 18, 2018
pact_broker_database.sqlite3 chore: update example broker path to point to local codebase Nov 11, 2017

README.md

Run Pact Broker example

The configuration for this example should not be used in production. Either use the Docker Pact Broker image, or copy the pact_broker directory from the Docker project as your starting point. Ensure you configure a web server/reverse proxy (such as Passenger/Nginx) in front of it (you can also copy the configuration for these from the Docker image.)

Clone project

git clone https://github.com/pact-foundation/pact_broker

Change directory to example

cd pact_broker/example

Run with sqlite database

Install dependencies

bundle install

Run Pact Broker

bundle exec rackup

Run with postgres database

Uncomment gem 'pg' in the Gemfile

Comment out gem 'sqlite3' in the Gemfile

Comment out the line with DATABASE_CREDENTIALS = {adapter: "sqlite"... in the config.ru.

Uncomment the line with DATABASE_CREDENTIALS = {adapter: "postgres".... in the config.ru.

Set up postgres database

psql postgres -c "CREATE DATABASE pact_broker;"
psql postgres -c "CREATE ROLE pact_broker WITH LOGIN PASSWORD 'CHANGE_ME';"
psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE pact_broker TO pact_broker;"

Install dependencies

bundle install

Run Pact Broker

bundle exec rackup

If you need an example data run following command

psql pact_broker < example_data.sql

Now Pact Broker can be access locally at http://localhost:9292.

You can’t perform that action at this time.