Connect

exports.version

Framework version.

Source

exports.version = '2.7.11';

exports.mime

Expose mime module.

Source

exports.mime = require('./middleware/static').mime;

exports.proto

Expose the prototype.

Source

exports.proto = proto;

exports.middleware

Auto-load middleware getters.

Source

exports.middleware = {};

exports.utils

Expose utilities.

Source

exports.utils = utils;

createServer()

Create a new connect server.

Source

function createServer() {
  function app(req, res, next){ app.handle(req, res, next); }
  utils.merge(app, proto);
  utils.merge(app, EventEmitter.prototype);
  app.route = '/';
  app.stack = [];
  for (var i = 0; i < arguments.length; ++i) {
    app.use(arguments[i]);
  }
  return app;
};

createServer.createServer

Support old .createServer() method.

Source

createServer.createServer = createServer;

Auto-load bundled middleware with getters.

Source

fs.readdirSync(__dirname + '/middleware').forEach(function(filename){
  if (!/\.js$/.test(filename)) return;
  var name = basename(filename, '.js');
  function load(){ return require('./middleware/' + name); }
  exports.middleware.__defineGetter__(name, load);
  exports.__defineGetter__(name, load);
});