# breeze-web **Repository Path**: five77/breeze-web ## Basic Information - **Project Name**: breeze-web - **Description**: 第一版基于Koa构建web能力 - **Primary Language**: NodeJS - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-02-04 - **Last Updated**: 2022-07-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # breeze-web #### 介绍 第一版基于Koa构建web能力,该中间件包含了缓存,权限验证,参数序列化等插件 #### 快速开始 ``` npm install breeze-web ``` 中间件启动事例 ``` DefaultConfig.middlewares.push({ name : "web" , require : Web , desc : "web服务" , port : 9001 , actionPath : __dirname + "/action" , handler : [ { name : "错误统一处理插件" , entity : ErrorHandler } , { name : "权限验证处理插件" , entity : AuthHandler } , { name : "请求统一处理插件" , entity : PackageHandler } , ] }) ``` Action代码片段: ``` const { BaseAction , RequestParser , RequestAuth } = require("breeze-web") const IndexAction = new BaseAction("test") const ParamOption = RequestParser.ParamOption IndexAction.get({ path : "/ok" } , async ctx => { ctx.body = "run ok." }) module.exports = IndexAction ``` 其中handler部分为web插件,独立存在,更多的使用参考 breeze-example