Foodtruck Order — TypeScript Reference - v0.1.0
    Preparing search index...

    Interface BuildAppOptions

    Dependencies required to construct the Fastify application.

    The HTTP layer receives its collaborators through this interface instead of constructing them itself, so the API can be built with a real or a fake MessageService (integration and unit tests use the two sides of that boundary).

    interface BuildAppOptions {
        auth?: AuthHttpOptions;
        corsAllowedOrigins?: string[];
        generateRequestId?: () => string;
        logger?:
            | boolean
            | FastifyLoggerOptions<
                RawServerDefault,
                FastifyRequest<
                    RouteGenericInterface,
                    RawServerDefault,
                    IncomingMessage,
                    FastifySchema,
                    FastifyTypeProviderDefault,
                    unknown,
                    FastifyBaseLogger,
                    ResolveFastifyRequestType<
                        FastifyTypeProviderDefault,
                        FastifySchema,
                        RouteGenericInterface,
                    >,
                >,
                FastifyReply<
                    RouteGenericInterface,
                    RawServerDefault,
                    IncomingMessage,
                    ServerResponse<IncomingMessage>,
                    unknown,
                    FastifySchema,
                    FastifyTypeProviderDefault,
                    unknown,
                >,
            > & LoggerOptions<never, boolean>;
        messageService: MessageService;
        now?: () => number;
        surfboardWebhook?: SurfboardWebhookOptions;
        trustProxy?: string[];
    }
    Index
    auth?: AuthHttpOptions

    Authentication wiring; omitted only by focused legacy tests.

    corsAllowedOrigins?: string[]

    Exact browser origins allowed to access the API; empty disables CORS.

    generateRequestId?: () => string

    Server-owned request ID generator. Injection supports deterministic behavior tests.

    logger?:
        | boolean
        | FastifyLoggerOptions<
            RawServerDefault,
            FastifyRequest<
                RouteGenericInterface,
                RawServerDefault,
                IncomingMessage,
                FastifySchema,
                FastifyTypeProviderDefault,
                unknown,
                FastifyBaseLogger,
                ResolveFastifyRequestType<
                    FastifyTypeProviderDefault,
                    FastifySchema,
                    RouteGenericInterface,
                >,
            >,
            FastifyReply<
                RouteGenericInterface,
                RawServerDefault,
                IncomingMessage,
                ServerResponse<IncomingMessage>,
                unknown,
                FastifySchema,
                FastifyTypeProviderDefault,
                unknown,
            >,
        > & LoggerOptions<never, boolean>

    Fastify/Pino logger configuration or sink; tests default to quiet logging.

    messageService: MessageService

    The application-layer use case the HTTP routes delegate to.

    now?: () => number

    Monotonic clock used to calculate request durations.

    surfboardWebhook?: SurfboardWebhookOptions

    Surfboard webhook ingress wiring; present only when a webhook secret is configured.

    Omitting it leaves the ingress route unregistered, so a deployment without Surfboard exposes no webhook endpoint. The route is signature-authenticated and sits outside the session scope, so it needs no other wiring here.

    trustProxy?: string[]

    Explicit trusted reverse-proxy addresses or CIDRs.