• Preparing search index...
  • The search index is not available
@daiso-tech/core - v0.55.0
  • @daiso-tech/core
  • HttpRouter
  • use

Function use

  • use(
        coreHandler: WinterTcRequestHandler,
        middlewares: OneOrMore<WinterTcMiddleware>,
    ): WinterTcRequestHandler
  • Wraps a core WinterTcRequestHandler with one or more WinterTcMiddleware functions or objects, producing a new handler that applies the middlewares before delegating to the core.

    The middlewares are applied in reverse order so that the first middleware in the list runs outermost (receives the request first), following the standard onion/chain-of-responsibility pattern.

    Parameters

    • coreHandler: WinterTcRequestHandler

      The innermost handler to invoke after all middlewares have run. Typically the route-resolution logic.

    • middlewares: OneOrMore<WinterTcMiddleware>

      One or more WinterTC middleware functions or objects to wrap around the core handler.

    Returns WinterTcRequestHandler

    A new WinterTcRequestHandler with the middlewares applied.

    IMPORT_PATH: "@daiso-tech/core/http-router/middlewares"

    • Defined in src/http-router/middlewares/use.ts:32

Settings

Member Visibility
@daiso-tech/core - v0.55.0
  • Loading...

Generated using TypeDoc