Skip to content
Français

TriggerServerOptions

import type { TriggerServerOptions } from "@elie-laloum/outpost";
  • queueRequired
    TaskQueue
    Queue receiving the jobs; a rejected enqueue answers 503.
  • routesRequired
    readonly TriggerRoute[]
    At least one route with a unique path.
  • hostOptional
    string | undefined
    Listening address; defaults to 127.0.0.1. Expose the server through a TLS-terminating proxy.
  • portOptional
    number | undefined
    Listening port; 0 or omitted selects a free port reported in url.
  • maxBytesOptional
    number | undefined
    Request body limit in bytes; defaults to 1 MiB, at most 25 MiB. Larger bodies answer 413.
  • onErrorOptional
    ((error: unknown, failure: TriggerFailure) => void) | undefined
    Observes verification, routing and publication failures with the path and, after verification, the delivery; never receives secrets. Errors thrown by the callback are ignored.
export interface TriggerServerOptions {
  readonly queue: TaskQueue;
  readonly routes: readonly TriggerRoute[];
  /** Defaults to 127.0.0.1; expose through a TLS-terminating proxy. */
  readonly host?: string;
  readonly port?: number;
  /** Request body limit; defaults to 1 MiB, at most 25 MiB. */
  readonly maxBytes?: number;
  /** Observes rejected or failed requests; never receives secrets. */
  readonly onError?: (error: unknown, failure: TriggerFailure) => void;
}