Trilium Backend API
    Preparing search index...

    Interface ScriptRequest

    Minimal Express Request surface available to custom request handlers (a subset of Express's Request — re-declared here to keep this module self-contained). Only the commonly used members are typed; the real object is a full Express request.

    interface ScriptRequest {
        body: unknown;
        headers: Record<string, string | string[] | undefined>;
        method: string;
        params: Record<string, string>;
        query: Record<string, unknown>;
        url: string;
        get(headerName: string): string;
    }
    Index
    body: unknown

    Parsed request body (requires a matching body parser).

    headers: Record<string, string | string[] | undefined>

    Request headers (lower-cased names).

    method: string

    HTTP method, e.g. "GET", "POST".

    params: Record<string, string>

    Route/path parameters.

    query: Record<string, unknown>

    Parsed query-string parameters.

    url: string

    Request URL (path + query string).

    • Returns the value of the given (case-insensitive) header.

      Parameters

      • headerName: string

      Returns string