athene-api
Advanced tools
+10
-8
@@ -16,3 +16,2 @@ "use strict"; | ||
| const koaStatic = require("koa-static"); | ||
| const compress = require("koa-compress"); | ||
| const koaBody = require("koa-body"); | ||
@@ -64,10 +63,13 @@ const ModuleLoader_1 = require("./core/ModuleLoader"); | ||
| } | ||
| // TODO 这里有性能问题 暂时注释掉 | ||
| // 添加gzip/deflate压缩 | ||
| this._app.use(compress({ | ||
| filter: (content_type) => { | ||
| // 压缩Filter | ||
| return /html|text|javascript|css|json/i.test(content_type); | ||
| }, | ||
| threshold: 128 * 1024, // 超过64k就压缩 | ||
| })); | ||
| // this._app.use( | ||
| // compress({ | ||
| // filter: (content_type) => { | ||
| // // 压缩Filter | ||
| // return /html|text|javascript|css|json/i.test(content_type); | ||
| // }, | ||
| // threshold: 128 * 1024, // 超过64k就压缩 | ||
| // }), | ||
| // ); | ||
| // 静态文件代理 | ||
@@ -74,0 +76,0 @@ this._app.use(koaStatic('./public')); |
+1
-1
| { | ||
| "name": "athene-api", | ||
| "version": "2.0.19", | ||
| "version": "2.0.20", | ||
| "description": "athene-api", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
428935
0.01%9372
0.02%