Adding middlewares at arbitrary positions on stack #810

olalonde opened this Issue May 17, 2013 · 1 comment


None yet
2 participants

I'd like the ability to programmatically manipulate the middleware stack in this way for example:

app.before('bodyParser').use(function (req, res, next) {
    console.log('before body parser');

app.after('bodyParser').use(function (req, res, next) {
    console.log('after body parser');

I have written a third party module that implements this functionality and I was wondering if there was any chance I'd get a merge if I would implement it directly in Connect. I am planning to add more methods in the future such as app.remove('label'), etc.

The ability to manipulate the stack once it has been built is useful for frameworks that initialize a Connect stack for the user but want to let them modify the stack to their taste afterwards.

Looking forward for feedback.

See for the third party module I wrote.


jonathanong commented Sep 13, 2013

use his module if you want this, people!

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