Node Packaged Masterfully
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    connect-composepublic

    connect-compose

    Compose multiple connect middleware into single middleware.

    Example

    var connect = require('connect')
    var compose = require('connect-compose')
    var app = connect()
     
    function mw1 (req, res, next) {
      req.stuff = ['mw1']
      next()
    }
     
    function mw2 (req, res, next) {
      req.stuff.push('mw2')
      next()
    }
     
    function mw3 (req, res) {
      res.end(req.stuff.join(','))
    }
     
    app.use(compose([mw1, mw2]))
    app.use(mw3)
     
    app.listen(6060)
     

    License

    MIT

    Keywords

    none

    install

    npm i connect-compose

    Downloadslast 7 days

    120

    version

    0.0.1

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar