Type Alias MiddlewareConnectFn

MiddlewareConnectFn: (<ContainerType>(app: ContainerType, route?: string) => Router | ExpressMiddlewareLike | undefined)

The function a middleware uses to mount itself in the container.

Type declaration

    • <ContainerType>(app, route?): Router | ExpressMiddlewareLike | undefined
    • Type Parameters

      Parameters

      • app: ContainerType
      • Optionalroute: string

        This is optional because the implementation can use it as a "global widdleware", or for a specific route.

      Returns Router | ExpressMiddlewareLike | undefined

      The resource can choose to be enabled or not by returning the function, or undefined.