Open liweinan0423 opened 9 years ago
Before Moco, I used to use servlet in my project to do stub work. It took us a lot of time to setup infrastructure. That is why I designed Moco.
For your case, if I were you, I would run Moco as background process. You can specify a shutdown port to shutdown Moco if required.
From my perspective, your suggestion is still a good idea to improve Moco which can extend Moco scenario. From current implementation, you need to adapt HttpRequest and HttpResponse.
Anyway, your moco-servlet implementation is welcome.
Is it supported that get Moco running in a servlet environment? For example, we configure a servlet in web.xml like
So that, we can deploy our mocked services as a war file in tomcat server.
The reason I am proposing this feature is that we want to integrate the mocked services into Go Server, we want to start the mocked server at the start of a job and stop it when the job is completed. But if we start moco as standalone server by
java -jar mock-jar *****
, it will block the job to run the following tasks.I am also diving deeper with Moco and going to try to implement this feature myself, so please provide any feedback that would help.
Thanks!