62 Star 117 Fork 46

qthis / CiWeb

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

#CiWeb# 基于netty做了简单封装,方便快捷web接口开发。
支持开发时热更新
支持静态文件 和 websocket

#example#

public class Demo {
    public static void main(String[] args) {
        CiConfig config = new CiConfig();
        config.port(8080).fileDir("www").filePath("/img/;/js/;/css/")
        .handlerPackage("ci.demo") //框架搜索class文件时,限定某个package下面扫描
        .handlerDir("bin/"); //设置脚本搜索目录 或者 jar文件,具体看自己运行环境设置
        //配置文件可用- 看config-file目录下的模版
        CiService service = new CiService(config);
        service.start();
        service.dev();// 此方法设置后,会监控脚本 变化,实现热更新
    }
}

编写接口

http://domain/ClassName/MethodName?web参数

package ci.demo;
import ci.web.core.CiContext;
public class User {
    //http://127.0.0.1/user/hello
    public void hello(CiContext ctx){
        System.out.println("User.hello#"+ctx.params().toJSONString());
        ctx.send("User.hello");
    }
    //http://127.0.0.1/user/login?email=test@xx.com&pwd=xxx
    public void login(String email, String passWord){
        System.out.println("User.login#"+email+" : "+passWord);
        ctx.send("User.login");
    }
    //http://127.0.0.1/user/logout
    public String logout(){
        return "logout-ok";
    }
}

旧版-需要注解参数

WIKI

包路径说明
ci.web.core : http请求/http响应
ci.web.router : 路由处理,将请求解析到对应接口处理
ci.web.codec : http/websocket解码

空文件

简介

基于netty封装的简易web服务,适合java-web-api接口开发。 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/qthis/CiWeb.git
git@gitee.com:qthis/CiWeb.git
qthis
CiWeb
CiWeb
master

搜索帮助