EN | 中文
MIAO ("Miao Is A web demO generator", pronounced /mjɑʊ/) is a non-intrusive web demo generator that quickly converts a function or piece of code into a web UI for temporary demos or tests, out-of-the-box without a complex configuration process.
MIAO is not a Web framework, its focus is very different from the Web framework, MIAO is mainly used to create some small temporary demos or small online tools, rather than being used in production environments, and is not recommended for formal projects.
MIAO is a trade-off between flexibility and ease of use, mainly focused on providing convenient, out-of-the-box temporary web demo generation, without providing too much configuration and custom UI/interaction features, and not like the Web framework, such as "Permission control", "Routing", "Template rendering", "Session" and other features. A small temporary demo can be created quickly in just three steps. Import the library -> Add annotations -> Start the server
MIAO currently only supports Java and Python, support for other languages (such as Golang,Haskell) will be added later, so stay tuned.
This tool is not yet fully developed, only some of the main features can be used at present, the rest of the features are planned to be implemented in the "Roadmap" section later
In pom.xml (Maven).
<dependencies>
<dependency>
<groupId>cn.voidnet</groupId>
<artifactId>MIAO</artifactId>
<version>0.0.10</version>
</dependency
</dependencies>
Alternatively, you can go to Release and download the jar and add it to your project's external library dependency directory
Then just put the @WebDemo annotation on the function you want to generate the UI for (obviously, only static functions)
@WebDemo
public static int getRandomNumber(int min, int max) {
return new Random().nextInt(max - min + 1) + min;
}
Finally, in the main function (or wherever you want to start the service), just start the server side of the tool
public static void main(String[] args) {
MIAO.start();
}
The start() function will block on execution, so place this line of code after the rest of your code in main, or open a new thread for this tool to serve.
Then you can automatically generate a temporary demo like this. !
Click "Execute" to execute and get the return value: !
Of course, this tool also provides some simple customization options, for example you can change the function name parameter names, etc.: !
@WebDemo("Add two numbers")
public static double add(
@Parameter("operand1") double opr1,
@Parameter("operand2") double opr2
) {
return opr1 + opr2;
}
! The title above can also be modified by means of the following parameters:
MIAO.start("Cat Ear Switch Controller");
[image:7698089C-E420-4322-BC71-4E2D3D77EA28-33798-00012951A6E99FCB/4C9314FA-D50A-4DC9-8D5A-285070BF659B.png]
More customization items will be added in the future (e.g. the way return values are displayed, parameters can be selected from optional, etc.)
PS: If you are using Gradle, please add mavenCentral() to the repositories, and then introduce this library.
PPS:Please set the function you want to generate the web demo and the class it is in to public to circumvent Java reflection restrictions
PPPS:Since this tool is not yet fully developed, only basic data types are supported for function parameters and return values for now, support for "images" "tables" "charts" "objects" "files" "videos" "function images" will be added later, see the "Roadmap" section
MIAO is an abbreviation for "Miao Is A web demO generator", and is also a Chinese syllable used to describe the sound of a cat's purr (meow, pronounced /mjɑʊ/), similar to "meow" and "にゃ" (≧∇≦).
When you mention the name of this framework, you can also call it MiaoLib to avoid ambiguity or confusion with cat calls.
.
. Possible examples: maven to gradle
MIAO is not a Web framework, its focus is very different from the Web framework, the two are more of a complementary relationship between MIAO is mainly concerned with the application of the following scenarios.
The following features will be added to this tool step by step. If you are interested in this project, you are also welcome to contribute code to this project by forking and PR.
If you have complex UI requirements, the Web framework may be a better choice.
Of course, we do not rule out the possibility of adding some simple UI theme settings to change the style or color of the UI, but will not provide such complex customization APIs as "modify the web structure and layout CSS style of the UI".
However, the UI code is also open source, you are welcome to directly fork the UI code (here is the code repository address) to modify it directly, and we will add the API to change the UI web page (front-end) later.
If you are interested in this project, you are also welcome to contribute code to this project by forking and PR.
If you encounter any problems with the code, or if you find bugs, you are welcome to give me feedback via Issue or contact me directly, and I will reply as soon as possible.
Contact: thevoid2333@gmail.com Or just create a issue.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。