A template project to allow the use of a pact stub service in combination with pre-generated PACT contract file, hosted inside a lambda function backed by API gateway.
- Accepts requests on any path via API gateway
- Spawns a pact-stub-server process and waits for it to start up
- Forwards any http request to the pact stub server
- Sends response from pact stub server, to client
For local running, pact-stub-service must be available on your command line.
you can download it here :- pact-ruby-standalone
Note:- Comment out the following to run locally in serverless.yml
layers:
- ${cf:pact-standalone-${self:provider.stage}.PactStandaloneLayerExport}
To run:
yarn install
make local-pact-service
make local-lambda-curl
- Add you required pact file, as
pact.json
in the base of the repository - Run
make layer-pact
to build the pact standalone layer - Run
make layer-deploy
to deploy the pact-standalone layer - Run
serverless deploy
to deploy the service
Note:- Dont forget to uncomment the layers
section in the serverless.yml
when performing step 4.