Closed arturmkrtchyan closed 9 years ago
Like having one server instance running but using different ports for different services:
mockServerClient('localhost', 1111).mockSimpleResponse('/service1', { 'key': 'Hello World!' }, 200);
mockServerClient('localhost', 2222).mockSimpleResponse('/service2', { 'key': 'Hello World!' }, 200);
mockServerClient('localhost', 3333).mockSimpleResponse('/service3', { 'key': 'Hello World!' }, 200);
Thanks, Artur
How are you running MockSever? Supporting multiple port bindings is an extension that would be possible to add. However, could you not just mock all the services using a single port. It would be as if all the services had the same port? If you bind the same MockServer instance to multiple ports it will ultimately expose all the same expectations so logically it would behave as if all services where mocked with the same port.
I'm planning to use MockServer for my node.js app. My node app talks to 10+services and they all have different ports. Ideally I can make them all to use the same port and configure it in my mock-config file. Or I can even run multiple instances of MockServer as they are lightweight based on netty.
So in general I don't think that my proposal is going to add big value to the mock-server. Feel free to close it.
As you pointed out it should be light weight and fine to run multiple versions. I'll close this but if you have any issues or more input let me know.
Hi @jamesdbloom
Great project! Would you be open for the following contribution ?
Our app is using 10 different services and we want to avoid having 10 different netty instances running. What if I contribute back with the capability of netty binding dynamically to the port requested by the client lib.
or just using administrative port and other ports can be used just for pattern matching ?
Thanks, Artur