ee-core
ee-core copied to clipboard
[feat] 新增 koa 静态服务支持 & HttpServer 自定义 filter 请求过滤器
可配置 是否启用 静态服务 以及自定义 请求过滤
{
httpServer: {
static: {
enable: true,
prefix: '/public',
path: path.join(getExtraResourcesDir(), 'public'),
options: {}
},
filter: (uriPath, ctx) => {
if (uriPath.startsWith('/public')) {
return true;
}
if (uriPath == 'ee') {
ctx.response.body = 'hello ee'
return true;
}
return false;
},
}}