FynMesh API
    Preparing search index...

    Type Alias FynAppMiddleware

    Enhanced middleware implementation interface

    type FynAppMiddleware = {
        autoApplyScope?: ("all" | "fynapp" | "middleware")[];
        name: string;
        apply?(context: FynAppMiddlewareCallContext): void | Promise<void>;
        canOverrideExecution?(fynApp: FynApp, fynUnit: FynUnit): boolean;
        overrideExecute?(context: FynAppMiddlewareCallContext): Promise<void>;
        overrideInitialize?(
            context: FynAppMiddlewareCallContext,
        ): Promise<{ mode?: string; status: string }>;
        setup?(
            context: FynAppMiddlewareCallContext,
        ): Promise<void | { share?: any; status: string }>;
        shouldApply?(fynApp: FynApp): boolean;
    }
    Index
    autoApplyScope?: ("all" | "fynapp" | "middleware")[]

    Controls automatic application. Explicit useMiddleware() calls always work regardless of autoApplyScope

    name: string

    name of the middleware

    • Execution override capabilities

      Parameters

      Returns boolean

    • one time setup for the middleware

      Parameters

      Returns Promise<void | { share?: any; status: string }>

    • Optional filter function to determine if this middleware should apply to a specific FynApp

      Parameters

      Returns boolean