1 Star 1 Fork 0

菩提祖师 / lweb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

非常轻量级的webAPI

简单实现web接口

简单示例

1.先实现RequestHandle的接口

public class MyRequestHandle extends RequestHandle {
     @Override
     public void taskExecute(RequestPacket requestPacket, ResponsePacket responsePacket) {
         System.out.println(Thread.currentThread().getId());
         responsePacket.write(LocalDateTime.now().toString().getBytes(StandardCharsets.UTF_8));
     }
}

2.传入RequestHandle

public class test {
    public static void main(String[] args) throws Exception{
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5,10,0, TimeUnit.SECONDS,new LinkedBlockingDeque<>());
        WebServer server = new WebServer(MyRequestHandle.class,8080,threadPoolExecutor);
        server.start();
    }
}

空文件

简介

超轻量级web-api框架,实现简单api接口 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/xunpou/lweb.git
git@gitee.com:xunpou/lweb.git
xunpou
lweb
lweb
master

搜索帮助