feat: ServerConfiguration新增middleware配置
This commit is contained in:
parent
2114f959e6
commit
904a9a6b5e
|
|
@ -244,6 +244,7 @@ function resolveCompiledImportPath(sourceFilePath, outputFilePath, importPath, p
|
|||
return importPath;
|
||||
}
|
||||
if (sourceFilePath.startsWith("node_modules")) {
|
||||
// 如果是node_modules下的文件,保持原有的处理逻辑
|
||||
return importPath.startsWith('.') ? (relative
|
||||
? path_1.default.join(relative, importPath).replace(/\\/g, '/')
|
||||
: path_1.default.join('..', importPath).replace(/\\/g, '/')) : importPath;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ export type ServerConfiguration = {
|
|||
socket?: (ctx: Koa.ParameterizedContext<any, KoaRouter.IRouterParamContext<any, {}>, any>) => {
|
||||
url: string;
|
||||
} | undefined;
|
||||
middleware?: Koa.Middleware[] | ((app: Koa<Koa.DefaultState, Koa.DefaultContext>) => Koa.Middleware[]);
|
||||
};
|
||||
/**
|
||||
* 前后台访问配置
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ export type ServerConfiguration = {
|
|||
internalExceptionMask?: string;
|
||||
koaBody?: IKoaBodyOptions, // koa-body配置
|
||||
socket?: (ctx: Koa.ParameterizedContext<any, KoaRouter.IRouterParamContext<any, {}>, any>) => { url: string } | undefined;
|
||||
middleware?: Koa.Middleware[] | ((app: Koa<Koa.DefaultState, Koa.DefaultContext>) => Koa.Middleware[]); // 自定义中间件
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue