Skip to content

Pass existing Middlewares to connect-controller constructor #20

Description

@fmcarvalho

An action method can be specified by an array, which represents a stack of Middlewares instead of a single action method.

Each array element is a function or a string corresponding to the name of a Middleware.

Example:

const controller = connectCtr('usersCtr', {
  mws: {
    isAuthenticated: passportConfig.isAuthenticated
  }
})

Example usersCtr:

module.exports = {
  'get_profile': [ 'isAuthenticated', get_profile]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions