Stratal API Reference
    Preparing search index...

    Class MiddlewareConsumerImpl

    Consumer for configuring middleware in modules

    Provides fluent API for registering middleware with route targeting. Used by modules implementing MiddlewareConfigurable interface.

    @Module({ providers: [...] })
    export class AppModule implements MiddlewareConfigurable {
    configure(consumer: MiddlewareConsumer): void {
    // Global logging middleware (excludes health check)
    consumer
    .apply(LoggingMiddleware)
    .exclude('/health')
    .forRoutes('*')

    // CORS middleware for specific controllers
    consumer
    .apply(CorsMiddleware)
    .forRoutes(ApiController, WebhooksController)

    // Rate limiting for auth endpoints
    consumer
    .apply(RateLimitMiddleware)
    .forRoutes({ path: '/api/v1/auth/*', method: 'post' })
    }
    }

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods