@aomex/web
Advanced tools
Comparing version 0.0.1 to 0.0.2
# @aomex/web | ||
## 0.0.2 | ||
### Patch Changes | ||
- [`cdb1405`](https://github.com/aomex/aomex/commit/cdb1405ccb557c122fc6b6cfdc8b845caacba87c) Thanks [@geekact](https://github.com/geekact)! - 使全局中间件生效 | ||
## 0.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -116,4 +116,5 @@ import { Chain, PureChain, PureMiddlewareToken, Next, Middleware, OpenAPI, Validator, TValidatorOptional, ValidatorTransformFn, TransformedValidator, ValidateResult, ValidatorOptions, GetValidatorType } from '@aomex/core'; | ||
readonly options: WebAppOption; | ||
readonly globalChainPoint?: string; | ||
protected readonly middlewareList: WebMiddlewareToken[]; | ||
constructor(options?: WebAppOption); | ||
protected readonly middlewareList: WebMiddlewareToken[]; | ||
listen: Server['listen']; | ||
@@ -120,0 +121,0 @@ callback(): RequestListener<any, any>; |
@@ -126,3 +126,3 @@ // src/override/middleware.ts | ||
import { EOL } from "node:os"; | ||
import { compose } from "@aomex/core"; | ||
import { Chain as Chain2, compose } from "@aomex/core"; | ||
import { color } from "@aomex/helper"; | ||
@@ -397,4 +397,13 @@ | ||
this.options = options; | ||
if (options.globalChain) { | ||
this.globalChainPoint = Chain2.createPoint(options.globalChain); | ||
this.middlewareList = Chain2.flatten( | ||
options.globalChain | ||
); | ||
} else { | ||
this.middlewareList = []; | ||
} | ||
} | ||
middlewareList = []; | ||
globalChainPoint; | ||
middlewareList; | ||
listen = (...args) => { | ||
@@ -401,0 +410,0 @@ const server = createServer( |
{ | ||
"name": "@aomex/web", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
65493
850