简体   繁体   中英

mountebank how to merge 2 imposter into one file

I have 2 applications, each uses the same mountebank (docker image).

I maintained 2 separate "imposter" files because we run the application at a different machine.

I wanted to run 2 applications at the same machine, maintain one mountebank docker image only. How can I merge the file into 1?

It's hard to give you a proper answer to your questions because there are some missing details. Like is mountebank running in front of both applications? O is it proxying something down from your applications? (this would indicate more you need to change the imposter config or stub proxy response)

I would dare to you say that you can merge your mountebank files into only one on both options. If mountebank is the front of both applications you'll basically have two imposter objects into the JSON/config file, one for each application, mountebank would be listening to two ports or two domains (to be able to differentiate the applications) and you would identify this into each imposter and each imposter has your already existing stub criteria. If mountebank is down from your application to proxy another service you would have a single imposter but you would need to add one predicate to identify the application origin on each existing stub.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM