pact-foundation / pact-stub-server

Standalone pact stub server
MIT License
75 stars 19 forks source link

Health check #70

Open shishkin opened 1 month ago

shishkin commented 1 month ago

As far as I understand, stub server only responds to requests from the pacts. I think it would make sense to also add a diagnostics route like /health or maybe better something like /_pact/health that could be used by infrastructure to know when the service is ready and if it is alive. I'm using process-compose to orchestrate dev environment and process compose can only do HTTP and command execution checks.

rholshausen commented 2 weeks ago

You could add a Pact with a single interaction that has the health route that just returns a 200 OK

shishkin commented 2 weeks ago

That would require the provider to implement that same route for verification to pass. That may not be desirable or even possible.

rholshausen commented 2 weeks ago

Why? The stub server doesn't do verification, it just there to be a pretend server.

shishkin commented 2 weeks ago

Oh, I see. I think you mean I can create a separate pact, that I don't have to verify but just feed it to the stub server. That would work.