code: function(req, res, next) {
      Tag.findOne({ name: req.params.name }, function(err, tag) {
        if (err) return next(err);
        if (!tag) return res.json(404, { error: 'failed to load tag ' + req.params.name });
        req.tag = tag;
        next();
      });
    }
docs: tag route middleware