Package Exports
- awix
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (awix) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
awix
基于HTTP/2模块和async/await关键字的web框架,支持功能:
- 中间件
- 路由分组/中间件分组
- 解析Body数据
- 限制请求数量
- 守护进程模式
- cluster集群
- 全局日志
- 显示负载情况
安装
npm安装
#全局请使用 npm install -g awix
npm install awix
git方式
git clone此仓库,然后引入awix.js文件。
示例
const awix = require('awix');
var srv = new awix({
debug : false
});
srv.config.https_on = true;
srv.config.key = './localhost.key.pem';
srv.config.cert = './localhost.cert.pem';
var {router} = srv;
router.get('/' async rr => {
rr.res.data = 'success';
});
//使用run接口只会启动一个进程,daemon会使用cluster集群。
srv.daemon(8118);