Awesome
<img src="moco-doc/DukeChoice-960x90-lm.png?raw=true"> <a href="https://github.com/dreamhead/moco"> <img src="moco-doc/moco.png?raw=true" width="100px"> </a>Moco
Moco is an easy setup stub framework.
Latest Release
User Voice
- Let me know if you are using Moco.
- Join Moco mailing list to discuss.
Why
Integration, especially based on HTTP protocol, e.g. web service, REST etc, is wildly used in most of our development.
In the old days, we just deployed another WAR to an application server, e.g. Jetty or Tomcat etc. As we all know, it's so boring to develop a WAR and deploy it to any application server, even if we use an embeded server. And the WAR needs to be reassembled even if we just want to change a little bit.
Quick Start
- Download Standalone Moco Runner
- Write your own configuration file to describe your Moco server configuration as follow:
[
{
"response" :
{
"text" : "Hello, Moco"
}
}
]
(foo.json)
- Run Moco HTTP server with the configuration file.
java -jar moco-runner-<version>-standalone.jar http -p 12306 -c foo.json
- Now, open your favorite browser to visit http://localhost:12306 and you will see "Hello, Moco".
Documents
- More Usages
- Detailed HTTP APIs or Socket APIs
- Detailed REST API
- Detailed Websocket API
- Global Settings for multiple configuration files.
- Command Line Usages
- Extend Moco if current API does not meet your requirement.
Build
Make sure you have JDK and Gradle installed.
- Clone Moco
git clone git@github.com:dreamhead/moco.git
- Build Moco
./gradlew build
- Build uberjar
./gradlew uberjar
- Check code before commit
./gradlew check
Contributing
Check out what you can help here if you do not have any existing idea.
Copyright and license
Copyright 2012-2023 ZHENG Ye
Licensed under MIT License (the "License"); You may obtain a copy of the License in the LICENSE file, or at:
https://raw.github.com/dreamhead/moco/master/MIT-LICENSE.txt