PSPDFKit-labs / bypass

Bypass provides a quick way to create a custom plug that can be put in place instead of an actual HTTP server to return prebaked responses to client requests.
https://hex.pm/packages/bypass
MIT License
964 stars 111 forks source link

Add endpoint_url #118

Open thiamsantos opened 3 years ago

thiamsantos commented 3 years ago

Motivation

Sometime can be a little annoying to add the endpoint_url to every test file or add it to the test case. As the endpoint url is something that in the majority of times the test needs to interact to be able to use bypass, seems to make sense that it could be grabbed easily. The port seems to be something more internal that not all tests would need to know and use.

Proposed Solution

Add endpoint_url field to bypass struct. Existing code would work normally with existing port attribute.