Refactoring similar routes in Express, extracting callbacks to separate modules

I have separated my routes into different modules. However, there still is a fair amount of duplication. Are there some good practices and conventions that are taking shape around how to extract code out of routes?

I have numerous routes that effectively look like this (Express 4.x):

router.get('/:something', function(req, res, next) {
  manipulate(something);
  Model.findOne( ..., function (err, model) {
    doSomethingInterestingWith(model, function(err, model) {
      res.render('template', { something: model} );
    });
  });
});

router.post('/:something', function(req, res, next) {
  manipulate(something);
  Model.new( {...}).save( function(err, model) {
    res.redirect('/:something');
  });
});

This is in a file called, for example, routes/something.js.

I'm fiddling with ways to extract the guts of each route into a function that can be extracted to a separate file. I've tried to simplify the example as much as possible, to keep this readable, but in reality, there is a fair amount of code before the call to render. The nested callbacks make my extracted functions pretty ugly. I've thought about using Q and promises, but I'm fearful of using a sledgehammer to swat a fly.

Not sure I understood you question fully based on your first part of question you can achieve this in two ways.

Little Cleaner way

Move the common logic to router.param

router.param will get executed for any request methods once in this case "GET" and "POST" http://expressjs.com/4x/api.html#router.param

router.param('name', function(req, res, next) {
    manipulate(something);
    //set return value if needed
    //req.something = manipulate(something);
    next();
});

router.get('/:something', function(req, res) {
  //access returned value if needed
  //var modifiedSomething = req.params.something;
  Model.findOne( ..., function (err, model) {
    doSomethingInterestingWith(model, function(err, model) {
      res.render('template', { something: model} );
    });
  });
});

router.post('/:something', function(req, res) {
  //access returned value if needed
  //var modifiedSomething = req.params.something;
  Model.new( {...}).save( function(err, model) {
    res.redirect('/:something');
  });
});

More Cleaner way

Make use of .all and chain the callbacks.

"/:something" request .all() callback will always run once and then based on the request method "GET" or "POST" corresponding callbacks will get executed.

http://expressjs.com/4x/api.html#router.route

router.route('/:something')
.all(function (request, response, next) {
    manipulate(something);
    next();
})
.get(function(req, res) {
  Model.findOne( ..., function (err, model) {
    doSomethingInterestingWith(model, function(err, model) {
      res.render('template', { something: model} );
    });
  });
})
.post(function(req, res) {
  Model.new( {...}).save( function(err, model) {
    res.redirect('/:something');
  });
});