During my e2e test I am using supertest together with the nestjs application. This is not starting a Webserver, because I want to collect coverage.
However I need to publish metadata (openid connect information) which includes also the URL of the service. Right now these values are defined in the constructor and passed via env.
So I see two approaches:
- instead of a random port, bind it to a static one that is known (like 3000)
- pass the value after the start to set it.
Creating the response based on the request by using the host paramter would be one approach, but I am not sure if this will work when using a proxy.