• Method decorator which accepts an array of Express middleware callback functions to run prior to the Express route being executed

    Example

    @Controller('/api', 'User', 'User Management Routes')
    class User {

    @Middleware([verifyAuthenticated, checkAdminPermissions], [{ "bearerAuth": [] }])
    @HttpPost('/user', 'Create a new user')
    async createUser(
    @RequestParam('username') username: string,
    @RequestParam('password') password: string,
    @Response() res: ExpressResponse
    ): Promise<void> {
    ...
    }
    }

    Type Parameters

    • T

      Class method to be registered with the Express application as a route

    Parameters

    Returns ((target: T, propertyKey: string) => void)

      • (target: T, propertyKey: string): void
      • Parameters

        • target: T
        • propertyKey: string

        Returns void

Generated using TypeDoc