dreamhead / moco

Easy Setup Stub Server
MIT License
4.36k stars 1.08k forks source link

是否能动态加载json文件 #288

Open 1657486787 opened 3 years ago

1657486787 commented 3 years ago

你好,我使用 java -jar .moco-runner-1.1.0-standalone.jar http -p 10001 -c "*.json" 加载多配置文件。发现新增一个json文件,如user.json时,并不能自动加载。而是需要重启项目才行。 希望能够动态加载配置文件

dreamhead commented 3 years ago

Do you mean that you add a new JSON file to your directory?

liuyuanxiang commented 3 years ago

I have the same question. @dreamhead After run java -jar .moco-runner-1.1.0-standalone.jar http -p 10001 -c "*.json" , I add a new JSON file to current directory. It doesn't work.

dreamhead commented 3 years ago

There is no such feature for now.

Moco can detect file content change, rather than a new file.

beclever commented 2 years ago

没生效呢。启动方式是 HttpServer server = MocoJsonRunner.jsonHttpServer(port, Moco.file(file)); runner = Runner.runner(server); runner.start();