code: function middleware(options) {
    options = options || {};
    for (var k in options) {
      settings[k] = options[k];
    }
    // set the tag format
    PARTIAL_PATTERN_RE = new RegExp(settings.open.replace(reg_meta, "\\$&") +
    "[-=]\\s*partial\\((.+)\\)\\s*" + settings.close.replace(reg_meta, "\\$&"), 'g');
    return function (req, res, next) {
      req.next = next;
      if (!res.req) {
        res.req = req;
      }
      res.render = render;
      next();
    };
  }
docs: connect-render: Template Render helper for connect
  
  Use case:
  
  var render = require('connect-render');
  var connect = require('connect');
  
  connect(
  render({
  root: __dirname + '/views',
  cache: true, // must set `true` in production env
  layout: 'layout.html', // or false for no layout
  helpers: {
  config: config,
  sitename: 'NodeBlog Engine',
  _csrf: function (req, res) {
  return req.session ? req.session._csrf : "";
  },
  }
  });
  );
  
  res.render('index.html', { title: 'Index Page', items: items });
  
  // no layout
  res.render('blue.html', { items: items, layout: false });
  
  @param {Object} [options={}] render options.
  - {String} layout, layout name, default is `'layout.html'`.
  Set `layout=''` or `layout=false` meaning no layout.
  - {String} root, view files root dir.
  - {Boolean} cache, cache view content or not, default is `true`.
  Must set `cache = true` on production.
  - {String} viewExt, view file extname, default is `''`.
  - {Object} [filters={}]
  - {Object} [helpers={}]
  @return {Function} render middleware for `connect`