Solon 1.hello world

2020-08-07  本文已影响0人  草编椅

solon 是一个微型的WEB框架,采用 Handler + Context + 插件 架构。理念:尽可能简化配置,尽可能的启动快速,尽可能减少Ioc,Aop。

一个 hello world 项目
<parent>
    <groupId>org.noear</groupId>
    <artifactId>solon-parent</artifactId>
    <version>1.0.9</version>
</parent>

<dependencies>
    <!-- solon 主框架 -->
    <dependency>
        <groupId>org.noear</groupId>
        <artifactId>solon</artifactId>
    </dependency>

    <!-- solon boot 插件(基于jlhttp包装,提供http服务) -->
    <dependency>
        <groupId>org.noear</groupId>
        <artifactId>solon.boot.jlhttp</artifactId>
    </dependency>
</dependencies>
package webapp;

import org.noear.solon.XApp;

public class App {
    public static void main(String[] args) {
        XApp app = XApp.start(App1.class, args);

        app.get("/", c -> c.output("hello world!"));
    }
}
希望会觉得简单...
上一篇 下一篇

猜你喜欢

热点阅读