@accelerated-software-development/caddy-api-client - v0.4.3
    Preparing search index...

    Variable SubrouteHandlerSchemaConst

    SubrouteHandlerSchema: ZodObject<
        {
            errors: ZodOptional<ZodAny>;
            handler: ZodLiteral<"subroute">;
            routes: ZodOptional<
                ZodArray<
                    ZodLazy<
                        ZodObject<
                            {
                                "@id": ZodOptional<ZodString>;
                                handle: ZodArray<
                                    ZodType<
                                        { handler: string; [key: string]: unknown },
                                        ZodTypeDef,
                                        { handler: string; [key: string]: unknown },
                                    >,
                                    "many",
                                >;
                                match: ZodOptional<
                                    ZodArray<
                                        ZodObject<
                                            { header: ...; host: ...; method: ...; path: ...; query: ... },
                                            "strip",
                                            ZodTypeAny,
                                            {
                                                header?: ...;
                                                host?: ...;
                                                method?: ...;
                                                path?: ...;
                                                query?: ...;
                                            },
                                            {
                                                header?: ...;
                                                host?: ...;
                                                method?: ...;
                                                path?: ...;
                                                query?: ...;
                                            },
                                        >,
                                        "many",
                                    >,
                                >;
                                priority: ZodOptional<ZodNumber>;
                                terminal: ZodOptional<ZodBoolean>;
                            },
                            "strip",
                            ZodTypeAny,
                            {
                                "@id"?: string;
                                handle: { handler: string; [key: string]: unknown }[];
                                match?: {
                                    header?: (...) | (...);
                                    host?: (...) | (...);
                                    method?: (...) | (...);
                                    path?: (...) | (...);
                                    query?: (...) | (...);
                                }[];
                                priority?: number;
                                terminal?: boolean;
                            },
                            {
                                "@id"?: string;
                                handle: { handler: string; [key: string]: unknown }[];
                                match?: {
                                    header?: (...) | (...);
                                    host?: (...) | (...);
                                    method?: (...) | (...);
                                    path?: (...) | (...);
                                    query?: (...) | (...);
                                }[];
                                priority?: number;
                                terminal?: boolean;
                            },
                        >,
                    >,
                    "many",
                >,
            >;
        },
        "strip",
        ZodTypeAny,
        {
            errors?: any;
            handler: "subroute";
            routes?: {
                "@id"?: string;
                handle: { handler: string; [key: string]: unknown }[];
                match?: {
                    header?: Record<string, (...)[]>;
                    host?: string[];
                    method?: ((...) | (...) | (...) | (...) | (...) | (...) | (...))[];
                    path?: string[];
                    query?: Record<string, (...)[]>;
                }[];
                priority?: number;
                terminal?: boolean;
            }[];
        },
        {
            errors?: any;
            handler: "subroute";
            routes?: {
                "@id"?: string;
                handle: { handler: string; [key: string]: unknown }[];
                match?: {
                    header?: Record<string, (...)[]>;
                    host?: string[];
                    method?: ((...) | (...) | (...) | (...) | (...) | (...) | (...))[];
                    path?: string[];
                    query?: Record<string, (...)[]>;
                }[];
                priority?: number;
                terminal?: boolean;
            }[];
        },
    > = ...

    Subroute handler schema - nested route handling

    Groups routes together for organization and conditional execution. Commonly used for path-prefixed sections or error handling.

    const handler = SubrouteHandlerSchema.parse({
    handler: "subroute",
    routes: [
    {
    match: [{ path: ["/api/*"] }],
    handle: [{ handler: "reverse_proxy", upstreams: [{ dial: "localhost:3000" }] }]
    },
    {
    handle: [{ handler: "static_response", status_code: 404 }]
    }
    ]
    });