Skip to content

Pass existing Middlewares to connect-controller constructor #20

Open
@fmcarvalho

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]
}

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