refactor(httpkernel): introduce configuration object for flexibility

- Replace individual constructor arguments with a configuration object.
- Add IHttpKernelConfig interface to standardize configuration structure.
- Refactor route builder and response decorator usage to use config.
- Simplify code and improve extensibility by consolidating parameters.

Signed-off-by: Max P. <Mail@MPassarello.de>
This commit is contained in:
2025-05-07 13:56:56 +02:00
parent 0990cacb22
commit 9059bdda62
6 changed files with 35 additions and 12 deletions

View File

@@ -4,12 +4,12 @@ import { IMiddleware } from './IMiddleware.ts';
import { IRouteDefinition } from './IRouteDefinition.ts';
import { IContext } from './mod.ts';
export interface IRouteBuilderFactory {
export interface IRouteBuilderFactory<TContext extends IContext = IContext> {
new (
registerRoute: (route: IInternalRoute) => void,
registerRoute: (route: IInternalRoute<TContext>) => void,
def: IRouteDefinition,
mws?: IMiddleware[],
): IRouteBuilder;
mws?: IMiddleware<TContext>[],
): IRouteBuilder<TContext>;
}
/**