/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['express 3.0.6/application.js']) {
  _$jscoverage['express 3.0.6/application.js'] = [];
  _$jscoverage['express 3.0.6/application.js'][5] = 0;
  _$jscoverage['express 3.0.6/application.js'][21] = 0;
  _$jscoverage['express 3.0.6/application.js'][33] = 0;
  _$jscoverage['express 3.0.6/application.js'][34] = 0;
  _$jscoverage['express 3.0.6/application.js'][35] = 0;
  _$jscoverage['express 3.0.6/application.js'][36] = 0;
  _$jscoverage['express 3.0.6/application.js'][37] = 0;
  _$jscoverage['express 3.0.6/application.js'][38] = 0;
  _$jscoverage['express 3.0.6/application.js'][47] = 0;
  _$jscoverage['express 3.0.6/application.js'][49] = 0;
  _$jscoverage['express 3.0.6/application.js'][50] = 0;
  _$jscoverage['express 3.0.6/application.js'][51] = 0;
  _$jscoverage['express 3.0.6/application.js'][54] = 0;
  _$jscoverage['express 3.0.6/application.js'][55] = 0;
  _$jscoverage['express 3.0.6/application.js'][58] = 0;
  _$jscoverage['express 3.0.6/application.js'][59] = 0;
  _$jscoverage['express 3.0.6/application.js'][60] = 0;
  _$jscoverage['express 3.0.6/application.js'][61] = 0;
  _$jscoverage['express 3.0.6/application.js'][65] = 0;
  _$jscoverage['express 3.0.6/application.js'][66] = 0;
  _$jscoverage['express 3.0.6/application.js'][67] = 0;
  _$jscoverage['express 3.0.6/application.js'][68] = 0;
  _$jscoverage['express 3.0.6/application.js'][69] = 0;
  _$jscoverage['express 3.0.6/application.js'][70] = 0;
  _$jscoverage['express 3.0.6/application.js'][71] = 0;
  _$jscoverage['express 3.0.6/application.js'][75] = 0;
  _$jscoverage['express 3.0.6/application.js'][78] = 0;
  _$jscoverage['express 3.0.6/application.js'][81] = 0;
  _$jscoverage['express 3.0.6/application.js'][82] = 0;
  _$jscoverage['express 3.0.6/application.js'][84] = 0;
  _$jscoverage['express 3.0.6/application.js'][85] = 0;
  _$jscoverage['express 3.0.6/application.js'][88] = 0;
  _$jscoverage['express 3.0.6/application.js'][89] = 0;
  _$jscoverage['express 3.0.6/application.js'][103] = 0;
  _$jscoverage['express 3.0.6/application.js'][104] = 0;
  _$jscoverage['express 3.0.6/application.js'][107] = 0;
  _$jscoverage['express 3.0.6/application.js'][110] = 0;
  _$jscoverage['express 3.0.6/application.js'][113] = 0;
  _$jscoverage['express 3.0.6/application.js'][114] = 0;
  _$jscoverage['express 3.0.6/application.js'][115] = 0;
  _$jscoverage['express 3.0.6/application.js'][116] = 0;
  _$jscoverage['express 3.0.6/application.js'][117] = 0;
  _$jscoverage['express 3.0.6/application.js'][118] = 0;
  _$jscoverage['express 3.0.6/application.js'][119] = 0;
  _$jscoverage['express 3.0.6/application.js'][120] = 0;
  _$jscoverage['express 3.0.6/application.js'][121] = 0;
  _$jscoverage['express 3.0.6/application.js'][126] = 0;
  _$jscoverage['express 3.0.6/application.js'][129] = 0;
  _$jscoverage['express 3.0.6/application.js'][130] = 0;
  _$jscoverage['express 3.0.6/application.js'][131] = 0;
  _$jscoverage['express 3.0.6/application.js'][134] = 0;
  _$jscoverage['express 3.0.6/application.js'][171] = 0;
  _$jscoverage['express 3.0.6/application.js'][172] = 0;
  _$jscoverage['express 3.0.6/application.js'][173] = 0;
  _$jscoverage['express 3.0.6/application.js'][174] = 0;
  _$jscoverage['express 3.0.6/application.js'][175] = 0;
  _$jscoverage['express 3.0.6/application.js'][210] = 0;
  _$jscoverage['express 3.0.6/application.js'][211] = 0;
  _$jscoverage['express 3.0.6/application.js'][215] = 0;
  _$jscoverage['express 3.0.6/application.js'][216] = 0;
  _$jscoverage['express 3.0.6/application.js'][217] = 0;
  _$jscoverage['express 3.0.6/application.js'][218] = 0;
  _$jscoverage['express 3.0.6/application.js'][222] = 0;
  _$jscoverage['express 3.0.6/application.js'][223] = 0;
  _$jscoverage['express 3.0.6/application.js'][226] = 0;
  _$jscoverage['express 3.0.6/application.js'][227] = 0;
  _$jscoverage['express 3.0.6/application.js'][228] = 0;
  _$jscoverage['express 3.0.6/application.js'][232] = 0;
  _$jscoverage['express 3.0.6/application.js'][250] = 0;
  _$jscoverage['express 3.0.6/application.js'][251] = 0;
  _$jscoverage['express 3.0.6/application.js'][252] = 0;
  _$jscoverage['express 3.0.6/application.js'][253] = 0;
  _$jscoverage['express 3.0.6/application.js'][254] = 0;
  _$jscoverage['express 3.0.6/application.js'][255] = 0;
  _$jscoverage['express 3.0.6/application.js'][258] = 0;
  _$jscoverage['express 3.0.6/application.js'][259] = 0;
  _$jscoverage['express 3.0.6/application.js'][277] = 0;
  _$jscoverage['express 3.0.6/application.js'][278] = 0;
  _$jscoverage['express 3.0.6/application.js'][298] = 0;
  _$jscoverage['express 3.0.6/application.js'][299] = 0;
  _$jscoverage['express 3.0.6/application.js'][317] = 0;
  _$jscoverage['express 3.0.6/application.js'][318] = 0;
  _$jscoverage['express 3.0.6/application.js'][329] = 0;
  _$jscoverage['express 3.0.6/application.js'][330] = 0;
  _$jscoverage['express 3.0.6/application.js'][341] = 0;
  _$jscoverage['express 3.0.6/application.js'][342] = 0;
  _$jscoverage['express 3.0.6/application.js'][390] = 0;
  _$jscoverage['express 3.0.6/application.js'][391] = 0;
  _$jscoverage['express 3.0.6/application.js'][393] = 0;
  _$jscoverage['express 3.0.6/application.js'][394] = 0;
  _$jscoverage['express 3.0.6/application.js'][395] = 0;
  _$jscoverage['express 3.0.6/application.js'][396] = 0;
  _$jscoverage['express 3.0.6/application.js'][403] = 0;
  _$jscoverage['express 3.0.6/application.js'][404] = 0;
  _$jscoverage['express 3.0.6/application.js'][405] = 0;
  _$jscoverage['express 3.0.6/application.js'][408] = 0;
  _$jscoverage['express 3.0.6/application.js'][411] = 0;
  _$jscoverage['express 3.0.6/application.js'][412] = 0;
  _$jscoverage['express 3.0.6/application.js'][426] = 0;
  _$jscoverage['express 3.0.6/application.js'][427] = 0;
  _$jscoverage['express 3.0.6/application.js'][428] = 0;
  _$jscoverage['express 3.0.6/application.js'][429] = 0;
  _$jscoverage['express 3.0.6/application.js'][431] = 0;
  _$jscoverage['express 3.0.6/application.js'][436] = 0;
  _$jscoverage['express 3.0.6/application.js'][455] = 0;
  _$jscoverage['express 3.0.6/application.js'][456] = 0;
  _$jscoverage['express 3.0.6/application.js'][462] = 0;
  _$jscoverage['express 3.0.6/application.js'][463] = 0;
  _$jscoverage['express 3.0.6/application.js'][467] = 0;
  _$jscoverage['express 3.0.6/application.js'][470] = 0;
  _$jscoverage['express 3.0.6/application.js'][473] = 0;
  _$jscoverage['express 3.0.6/application.js'][476] = 0;
  _$jscoverage['express 3.0.6/application.js'][481] = 0;
  _$jscoverage['express 3.0.6/application.js'][484] = 0;
  _$jscoverage['express 3.0.6/application.js'][485] = 0;
  _$jscoverage['express 3.0.6/application.js'][491] = 0;
  _$jscoverage['express 3.0.6/application.js'][492] = 0;
  _$jscoverage['express 3.0.6/application.js'][493] = 0;
  _$jscoverage['express 3.0.6/application.js'][494] = 0;
  _$jscoverage['express 3.0.6/application.js'][498] = 0;
  _$jscoverage['express 3.0.6/application.js'][502] = 0;
  _$jscoverage['express 3.0.6/application.js'][503] = 0;
  _$jscoverage['express 3.0.6/application.js'][505] = 0;
  _$jscoverage['express 3.0.6/application.js'][530] = 0;
  _$jscoverage['express 3.0.6/application.js'][531] = 0;
  _$jscoverage['express 3.0.6/application.js'][532] = 0;
}
_$jscoverage['express 3.0.6/application.js'][5]++;
var connect = require("connect"), Router = require("./router"), methods = require("methods"), middleware = require("./middleware"), debug = require("debug")("express:application"), locals = require("./utils").locals, View = require("./view"), utils = connect.utils, path = require("path"), http = require("http"), join = path.join;
_$jscoverage['express 3.0.6/application.js'][21]++;
var app = exports = module.exports = {};
_$jscoverage['express 3.0.6/application.js'][33]++;
app.init = (function () {
  _$jscoverage['express 3.0.6/application.js'][34]++;
  this.cache = {};
  _$jscoverage['express 3.0.6/application.js'][35]++;
  this.settings = {};
  _$jscoverage['express 3.0.6/application.js'][36]++;
  this.engines = {};
  _$jscoverage['express 3.0.6/application.js'][37]++;
  this.viewCallbacks = [];
  _$jscoverage['express 3.0.6/application.js'][38]++;
  this.defaultConfiguration();
});
_$jscoverage['express 3.0.6/application.js'][47]++;
app.defaultConfiguration = (function () {
  _$jscoverage['express 3.0.6/application.js'][49]++;
  this.enable("x-powered-by");
  _$jscoverage['express 3.0.6/application.js'][50]++;
  this.set("env", process.env.NODE_ENV || "development");
  _$jscoverage['express 3.0.6/application.js'][51]++;
  debug("booting in %s mode", this.get("env"));
  _$jscoverage['express 3.0.6/application.js'][54]++;
  this.use(connect.query());
  _$jscoverage['express 3.0.6/application.js'][55]++;
  this.use(middleware.init(this));
  _$jscoverage['express 3.0.6/application.js'][58]++;
  this.on("mount", (function (parent) {
  _$jscoverage['express 3.0.6/application.js'][59]++;
  this.request.__proto__ = parent.request;
  _$jscoverage['express 3.0.6/application.js'][60]++;
  this.response.__proto__ = parent.response;
  _$jscoverage['express 3.0.6/application.js'][61]++;
  this.engines.__proto__ = parent.engines;
}));
  _$jscoverage['express 3.0.6/application.js'][65]++;
  this._router = new Router(this);
  _$jscoverage['express 3.0.6/application.js'][66]++;
  this.routes = this._router.map;
  _$jscoverage['express 3.0.6/application.js'][67]++;
  this.__defineGetter__("router", (function () {
  _$jscoverage['express 3.0.6/application.js'][68]++;
  this._usedRouter = true;
  _$jscoverage['express 3.0.6/application.js'][69]++;
  this._router.caseSensitive = this.enabled("case sensitive routing");
  _$jscoverage['express 3.0.6/application.js'][70]++;
  this._router.strict = this.enabled("strict routing");
  _$jscoverage['express 3.0.6/application.js'][71]++;
  return this._router.middleware;
}));
  _$jscoverage['express 3.0.6/application.js'][75]++;
  this.locals = locals(this);
  _$jscoverage['express 3.0.6/application.js'][78]++;
  this.locals.settings = this.settings;
  _$jscoverage['express 3.0.6/application.js'][81]++;
  this.set("views", process.cwd() + "/views");
  _$jscoverage['express 3.0.6/application.js'][82]++;
  this.set("jsonp callback name", "callback");
  _$jscoverage['express 3.0.6/application.js'][84]++;
  this.configure("development", (function () {
  _$jscoverage['express 3.0.6/application.js'][85]++;
  this.set("json spaces", 2);
}));
  _$jscoverage['express 3.0.6/application.js'][88]++;
  this.configure("production", (function () {
  _$jscoverage['express 3.0.6/application.js'][89]++;
  this.enable("view cache");
}));
});
_$jscoverage['express 3.0.6/application.js'][103]++;
app.use = (function (route, fn) {
  _$jscoverage['express 3.0.6/application.js'][104]++;
  var app;
  _$jscoverage['express 3.0.6/application.js'][107]++;
  if ("string" != typeof route) {
    _$jscoverage['express 3.0.6/application.js'][107]++;
    fn = route, route = "/";
  }
  _$jscoverage['express 3.0.6/application.js'][110]++;
  if (fn.handle && fn.set) {
    _$jscoverage['express 3.0.6/application.js'][110]++;
    app = fn;
  }
  _$jscoverage['express 3.0.6/application.js'][113]++;
  if (app) {
    _$jscoverage['express 3.0.6/application.js'][114]++;
    app.route = route;
    _$jscoverage['express 3.0.6/application.js'][115]++;
    fn = (function (req, res, next) {
  _$jscoverage['express 3.0.6/application.js'][116]++;
  var orig = req.app;
  _$jscoverage['express 3.0.6/application.js'][117]++;
  app.handle(req, res, (function (err) {
  _$jscoverage['express 3.0.6/application.js'][118]++;
  req.app = res.app = orig;
  _$jscoverage['express 3.0.6/application.js'][119]++;
  req.__proto__ = orig.request;
  _$jscoverage['express 3.0.6/application.js'][120]++;
  res.__proto__ = orig.response;
  _$jscoverage['express 3.0.6/application.js'][121]++;
  next(err);
}));
});
  }
  _$jscoverage['express 3.0.6/application.js'][126]++;
  connect.proto.use.call(this, route, fn);
  _$jscoverage['express 3.0.6/application.js'][129]++;
  if (app) {
    _$jscoverage['express 3.0.6/application.js'][130]++;
    app.parent = this;
    _$jscoverage['express 3.0.6/application.js'][131]++;
    app.emit("mount", this);
  }
  _$jscoverage['express 3.0.6/application.js'][134]++;
  return this;
});
_$jscoverage['express 3.0.6/application.js'][171]++;
app.engine = (function (ext, fn) {
  _$jscoverage['express 3.0.6/application.js'][172]++;
  if ("function" != typeof fn) {
    _$jscoverage['express 3.0.6/application.js'][172]++;
    throw new Error("callback function required");
  }
  _$jscoverage['express 3.0.6/application.js'][173]++;
  if ("." != ext[0]) {
    _$jscoverage['express 3.0.6/application.js'][173]++;
    ext = "." + ext;
  }
  _$jscoverage['express 3.0.6/application.js'][174]++;
  this.engines[ext] = fn;
  _$jscoverage['express 3.0.6/application.js'][175]++;
  return this;
});
_$jscoverage['express 3.0.6/application.js'][210]++;
app.param = (function (name, fn) {
  _$jscoverage['express 3.0.6/application.js'][211]++;
  var self = this, fns = [].slice.call(arguments, 1);
  _$jscoverage['express 3.0.6/application.js'][215]++;
  if (Array.isArray(name)) {
    _$jscoverage['express 3.0.6/application.js'][216]++;
    name.forEach((function (name) {
  _$jscoverage['express 3.0.6/application.js'][217]++;
  fns.forEach((function (fn) {
  _$jscoverage['express 3.0.6/application.js'][218]++;
  self.param(name, fn);
}));
}));
  }
  else {
    _$jscoverage['express 3.0.6/application.js'][222]++;
    if ("function" == typeof name) {
      _$jscoverage['express 3.0.6/application.js'][223]++;
      this._router.param(name);
    }
    else {
      _$jscoverage['express 3.0.6/application.js'][226]++;
      if (":" == name[0]) {
        _$jscoverage['express 3.0.6/application.js'][226]++;
        name = name.substr(1);
      }
      _$jscoverage['express 3.0.6/application.js'][227]++;
      fns.forEach((function (fn) {
  _$jscoverage['express 3.0.6/application.js'][228]++;
  self._router.param(name, fn);
}));
    }
  }
  _$jscoverage['express 3.0.6/application.js'][232]++;
  return this;
});
_$jscoverage['express 3.0.6/application.js'][250]++;
app.set = (function (setting, val) {
  _$jscoverage['express 3.0.6/application.js'][251]++;
  if (1 == arguments.length) {
    _$jscoverage['express 3.0.6/application.js'][252]++;
    if (this.settings.hasOwnProperty(setting)) {
      _$jscoverage['express 3.0.6/application.js'][253]++;
      return this.settings[setting];
    }
    else {
      _$jscoverage['express 3.0.6/application.js'][254]++;
      if (this.parent) {
        _$jscoverage['express 3.0.6/application.js'][255]++;
        return this.parent.set(setting);
      }
    }
  }
  else {
    _$jscoverage['express 3.0.6/application.js'][258]++;
    this.settings[setting] = val;
    _$jscoverage['express 3.0.6/application.js'][259]++;
    return this;
  }
});
_$jscoverage['express 3.0.6/application.js'][277]++;
app.path = (function () {
  _$jscoverage['express 3.0.6/application.js'][278]++;
  return this.parent? this.parent.path() + this.route: "";
});
_$jscoverage['express 3.0.6/application.js'][298]++;
app.enabled = (function (setting) {
  _$jscoverage['express 3.0.6/application.js'][299]++;
  return ! ! this.set(setting);
});
_$jscoverage['express 3.0.6/application.js'][317]++;
app.disabled = (function (setting) {
  _$jscoverage['express 3.0.6/application.js'][318]++;
  return ! this.set(setting);
});
_$jscoverage['express 3.0.6/application.js'][329]++;
app.enable = (function (setting) {
  _$jscoverage['express 3.0.6/application.js'][330]++;
  return this.set(setting, true);
});
_$jscoverage['express 3.0.6/application.js'][341]++;
app.disable = (function (setting) {
  _$jscoverage['express 3.0.6/application.js'][342]++;
  return this.set(setting, false);
});
_$jscoverage['express 3.0.6/application.js'][390]++;
app.configure = (function (env, fn) {
  _$jscoverage['express 3.0.6/application.js'][391]++;
  var envs = "all", args = [].slice.call(arguments);
  _$jscoverage['express 3.0.6/application.js'][393]++;
  fn = args.pop();
  _$jscoverage['express 3.0.6/application.js'][394]++;
  if (args.length) {
    _$jscoverage['express 3.0.6/application.js'][394]++;
    envs = args;
  }
  _$jscoverage['express 3.0.6/application.js'][395]++;
  if ("all" == envs || ~ envs.indexOf(this.settings.env)) {
    _$jscoverage['express 3.0.6/application.js'][395]++;
    fn.call(this);
  }
  _$jscoverage['express 3.0.6/application.js'][396]++;
  return this;
});
_$jscoverage['express 3.0.6/application.js'][403]++;
methods.forEach((function (method) {
  _$jscoverage['express 3.0.6/application.js'][404]++;
  app[method] = (function (path) {
  _$jscoverage['express 3.0.6/application.js'][405]++;
  if ("get" == method && 1 == arguments.length) {
    _$jscoverage['express 3.0.6/application.js'][405]++;
    return this.set(path);
  }
  _$jscoverage['express 3.0.6/application.js'][408]++;
  if (! this._usedRouter) {
    _$jscoverage['express 3.0.6/application.js'][408]++;
    this.use(this.router);
  }
  _$jscoverage['express 3.0.6/application.js'][411]++;
  this._router[method].apply(this._router, arguments);
  _$jscoverage['express 3.0.6/application.js'][412]++;
  return this;
});
}));
_$jscoverage['express 3.0.6/application.js'][426]++;
app.all = (function (path) {
  _$jscoverage['express 3.0.6/application.js'][427]++;
  var args = arguments;
  _$jscoverage['express 3.0.6/application.js'][428]++;
  methods.forEach((function (method) {
  _$jscoverage['express 3.0.6/application.js'][429]++;
  app[method].apply(this, args);
}), this);
  _$jscoverage['express 3.0.6/application.js'][431]++;
  return this;
});
_$jscoverage['express 3.0.6/application.js'][436]++;
app.del = app["delete"];
_$jscoverage['express 3.0.6/application.js'][455]++;
app.render = (function (name, options, fn) {
  _$jscoverage['express 3.0.6/application.js'][456]++;
  var opts = {}, cache = this.cache, engines = this.engines, view;
  _$jscoverage['express 3.0.6/application.js'][462]++;
  if ("function" == typeof options) {
    _$jscoverage['express 3.0.6/application.js'][463]++;
    fn = options, options = {};
  }
  _$jscoverage['express 3.0.6/application.js'][467]++;
  utils.merge(opts, this.locals);
  _$jscoverage['express 3.0.6/application.js'][470]++;
  if (options._locals) {
    _$jscoverage['express 3.0.6/application.js'][470]++;
    utils.merge(opts, options._locals);
  }
  _$jscoverage['express 3.0.6/application.js'][473]++;
  utils.merge(opts, options);
  _$jscoverage['express 3.0.6/application.js'][476]++;
  opts.cache = null == opts.cache? this.enabled("view cache"): opts.cache;
  _$jscoverage['express 3.0.6/application.js'][481]++;
  if (opts.cache) {
    _$jscoverage['express 3.0.6/application.js'][481]++;
    view = cache[name];
  }
  _$jscoverage['express 3.0.6/application.js'][484]++;
  if (! view) {
    _$jscoverage['express 3.0.6/application.js'][485]++;
    view = new View(name, {defaultEngine: this.get("view engine"), root: this.get("views"), engines: engines});
    _$jscoverage['express 3.0.6/application.js'][491]++;
    if (! view.path) {
      _$jscoverage['express 3.0.6/application.js'][492]++;
      var err = new Error("Failed to lookup view \"" + name + "\"");
      _$jscoverage['express 3.0.6/application.js'][493]++;
      err.view = view;
      _$jscoverage['express 3.0.6/application.js'][494]++;
      return fn(err);
    }
    _$jscoverage['express 3.0.6/application.js'][498]++;
    if (opts.cache) {
      _$jscoverage['express 3.0.6/application.js'][498]++;
      cache[name] = view;
    }
  }
  _$jscoverage['express 3.0.6/application.js'][502]++;
  try {
    _$jscoverage['express 3.0.6/application.js'][503]++;
    view.render(opts, fn);
  }
  catch (err) {
    _$jscoverage['express 3.0.6/application.js'][505]++;
    fn(err);
  }
});
_$jscoverage['express 3.0.6/application.js'][530]++;
app.listen = (function () {
  _$jscoverage['express 3.0.6/application.js'][531]++;
  var server = http.createServer(this);
  _$jscoverage['express 3.0.6/application.js'][532]++;
  return server.listen.apply(server, arguments);
});
_$jscoverage['express 3.0.6/application.js'].source = ["/**"," * Module dependencies."," */","","var connect = require('connect')","  , Router = require('./router')","  , methods = require('methods')","  , middleware = require('./middleware')","  , debug = require('debug')('express:application')","  , locals = require('./utils').locals","  , View = require('./view')","  , utils = connect.utils","  , path = require('path')","  , http = require('http')","  , join = path.join;","","/**"," * Application prototype."," */","","var app = exports = module.exports = {};","","/**"," * Initialize the server."," *"," *   - setup default configuration"," *   - setup default middleware"," *   - setup route reflection methods"," *"," * @api private"," */","","app.init = function(){","  this.cache = {};","  this.settings = {};","  this.engines = {};","  this.viewCallbacks = [];","  this.defaultConfiguration();","};","","/**"," * Initialize application configuration."," *"," * @api private"," */","","app.defaultConfiguration = function(){","  // default settings","  this.enable('x-powered-by');","  this.set('env', process.env.NODE_ENV || 'development');","  debug('booting in %s mode', this.get('env'));","","  // implicit middleware","  this.use(connect.query());","  this.use(middleware.init(this));","","  // inherit protos","  this.on('mount', function(parent){","    this.request.__proto__ = parent.request;","    this.response.__proto__ = parent.response;","    this.engines.__proto__ = parent.engines;","  });","","  // router","  this._router = new Router(this);","  this.routes = this._router.map;","  this.__defineGetter__('router', function(){","    this._usedRouter = true;","    this._router.caseSensitive = this.enabled('case sensitive routing');","    this._router.strict = this.enabled('strict routing');","    return this._router.middleware;","  });","","  // setup locals","  this.locals = locals(this);","","  // default locals","  this.locals.settings = this.settings;","","  // default configuration","  this.set('views', process.cwd() + '/views');","  this.set('jsonp callback name', 'callback');","","  this.configure('development', function(){","    this.set('json spaces', 2);","  });","","  this.configure('production', function(){","    this.enable('view cache');","  });","};","","/**"," * Proxy `connect#use()` to apply settings to"," * mounted applications."," *"," * @param {String|Function|Server} route"," * @param {Function|Server} fn"," * @return {app} for chaining"," * @api public"," */","","app.use = function(route, fn){","  var app;","","  // default route to '/'","  if ('string' != typeof route) fn = route, route = '/';","","  // express app","  if (fn.handle &amp;&amp; fn.set) app = fn;","","  // restore .app property on req and res","  if (app) {","    app.route = route;","    fn = function(req, res, next) {","      var orig = req.app;","      app.handle(req, res, function(err){","        req.app = res.app = orig;","        req.__proto__ = orig.request;","        res.__proto__ = orig.response;","        next(err);","      });","    };","  }","","  connect.proto.use.call(this, route, fn);","","  // mounted an app","  if (app) {","    app.parent = this;","    app.emit('mount', this);","  }","","  return this;","};","","/**"," * Register the given template engine callback `fn`"," * as `ext`."," *"," * By default will `require()` the engine based on the"," * file extension. For example if you try to render"," * a \"foo.jade\" file Express will invoke the following internally:"," *"," *     app.engine('jade', require('jade').__express);"," *"," * For engines that do not provide `.__express` out of the box,"," * or if you wish to \"map\" a different extension to the template engine"," * you may use this method. For example mapping the EJS template engine to"," * \".html\" files:"," *"," *     app.engine('html', require('ejs').renderFile);"," *"," * In this case EJS provides a `.renderFile()` method with"," * the same signature that Express expects: `(path, options, callback)`,"," * though note that it aliases this method as `ejs.__express` internally"," * so if you're using \".ejs\" extensions you dont need to do anything."," *"," * Some template engines do not follow this convention, the"," * [Consolidate.js](https://github.com/visionmedia/consolidate.js)"," * library was created to map all of node's popular template"," * engines to follow this convention, thus allowing them to"," * work seemlessly within Express."," *"," * @param {String} ext"," * @param {Function} fn"," * @return {app} for chaining"," * @api public"," */","","app.engine = function(ext, fn){","  if ('function' != typeof fn) throw new Error('callback function required');","  if ('.' != ext[0]) ext = '.' + ext;","  this.engines[ext] = fn;","  return this;","};","","/**"," * Map the given param placeholder `name`(s) to the given callback(s)."," *"," * Parameter mapping is used to provide pre-conditions to routes"," * which use normalized placeholders. For example a _:user_id_ parameter"," * could automatically load a user's information from the database without"," * any additional code,"," *"," * The callback uses the samesignature as middleware, the only differencing"," * being that the value of the placeholder is passed, in this case the _id_"," * of the user. Once the `next()` function is invoked, just like middleware"," * it will continue on to execute the route, or subsequent parameter functions."," *"," *      app.param('user_id', function(req, res, next, id){"," *        User.find(id, function(err, user){"," *          if (err) {"," *            next(err);"," *          } else if (user) {"," *            req.user = user;"," *            next();"," *          } else {"," *            next(new Error('failed to load user'));"," *          }"," *        });"," *      });"," *"," * @param {String|Array} name"," * @param {Function} fn"," * @return {app} for chaining"," * @api public"," */","","app.param = function(name, fn){","  var self = this","    , fns = [].slice.call(arguments, 1);","","  // array","  if (Array.isArray(name)) {","    name.forEach(function(name){","      fns.forEach(function(fn){","        self.param(name, fn);","      });","    });","  // param logic","  } else if ('function' == typeof name) {","    this._router.param(name);","  // single","  } else {","    if (':' == name[0]) name = name.substr(1);","    fns.forEach(function(fn){","      self._router.param(name, fn);","    });","  }","","  return this;","};","","/**"," * Assign `setting` to `val`, or return `setting`'s value."," *"," *    app.set('foo', 'bar');"," *    app.get('foo');"," *    // =&gt; \"bar\""," *"," * Mounted servers inherit their parent server's settings."," *"," * @param {String} setting"," * @param {String} val"," * @return {Server} for chaining"," * @api public"," */","","app.set = function(setting, val){","  if (1 == arguments.length) {","    if (this.settings.hasOwnProperty(setting)) {","      return this.settings[setting];","    } else if (this.parent) {","      return this.parent.set(setting);","    }","  } else {","    this.settings[setting] = val;","    return this;","  }","};","","/**"," * Return the app's absolute pathname"," * based on the parent(s) that have"," * mounted it."," *"," * For example if the application was"," * mounted as \"/admin\", which itself"," * was mounted as \"/blog\" then the"," * return value would be \"/blog/admin\"."," *"," * @return {String}"," * @api private"," */","","app.path = function(){","  return this.parent","    ? this.parent.path() + this.route","    : '';","};","","/**"," * Check if `setting` is enabled (truthy)."," *"," *    app.enabled('foo')"," *    // =&gt; false"," *"," *    app.enable('foo')"," *    app.enabled('foo')"," *    // =&gt; true"," *"," * @param {String} setting"," * @return {Boolean}"," * @api public"," */","","app.enabled = function(setting){","  return !!this.set(setting);","};","","/**"," * Check if `setting` is disabled."," *"," *    app.disabled('foo')"," *    // =&gt; true"," *"," *    app.enable('foo')"," *    app.disabled('foo')"," *    // =&gt; false"," *"," * @param {String} setting"," * @return {Boolean}"," * @api public"," */","","app.disabled = function(setting){","  return !this.set(setting);","};","","/**"," * Enable `setting`."," *"," * @param {String} setting"," * @return {app} for chaining"," * @api public"," */","","app.enable = function(setting){","  return this.set(setting, true);","};","","/**"," * Disable `setting`."," *"," * @param {String} setting"," * @return {app} for chaining"," * @api public"," */","","app.disable = function(setting){","  return this.set(setting, false);","};","","/**"," * Configure callback for zero or more envs,"," * when no `env` is specified that callback will"," * be invoked for all environments. Any combination"," * can be used multiple times, in any order desired."," *"," * Examples:"," *"," *    app.configure(function(){"," *      // executed for all envs"," *    });"," *"," *    app.configure('stage', function(){"," *      // executed staging env"," *    });"," *"," *    app.configure('stage', 'production', function(){"," *      // executed for stage and production"," *    });"," *"," * Note:"," *"," *  These callbacks are invoked immediately, and"," *  are effectively sugar for the following:"," *"," *     var env = process.env.NODE_ENV || 'development';"," *"," *      switch (env) {"," *        case 'development':"," *          ..."," *          break;"," *        case 'stage':"," *          ..."," *          break;"," *        case 'production':"," *          ..."," *          break;"," *      }"," *"," * @param {String} env..."," * @param {Function} fn"," * @return {app} for chaining"," * @api public"," */","","app.configure = function(env, fn){","  var envs = 'all'","    , args = [].slice.call(arguments);","  fn = args.pop();","  if (args.length) envs = args;","  if ('all' == envs || ~envs.indexOf(this.settings.env)) fn.call(this);","  return this;","};","","/**"," * Delegate `.VERB(...)` calls to `router.VERB(...)`."," */","","methods.forEach(function(method){","  app[method] = function(path){","    if ('get' == method &amp;&amp; 1 == arguments.length) return this.set(path);","","    // if no router attacked yet, attach the router","    if (!this._usedRouter) this.use(this.router);","","    // setup route","    this._router[method].apply(this._router, arguments);","    return this;","  };","});","","/**"," * Special-cased \"all\" method, applying the given route `path`,"," * middleware, and callback to _every_ HTTP method."," *"," * @param {String} path"," * @param {Function} ..."," * @return {app} for chaining"," * @api public"," */","","app.all = function(path){","  var args = arguments;","  methods.forEach(function(method){","    app[method].apply(this, args);","  }, this);","  return this;","};","","// del -&gt; delete alias","","app.del = app.delete;","","/**"," * Render the given view `name` name with `options`"," * and a callback accepting an error and the"," * rendered template string."," *"," * Example:"," *"," *    app.render('email', { name: 'Tobi' }, function(err, html){"," *      // ..."," *    })"," *"," * @param {String} name"," * @param {String|Function} options or fn"," * @param {Function} fn"," * @api public"," */","","app.render = function(name, options, fn){","  var opts = {}","    , cache = this.cache","    , engines = this.engines","    , view;","","  // support callback function as second arg","  if ('function' == typeof options) {","    fn = options, options = {};","  }","","  // merge app.locals","  utils.merge(opts, this.locals);","","  // merge options._locals","  if (options._locals) utils.merge(opts, options._locals);","","  // merge options","  utils.merge(opts, options);","","  // set .cache unless explicitly provided","  opts.cache = null == opts.cache","    ? this.enabled('view cache')","    : opts.cache;","","  // primed cache","  if (opts.cache) view = cache[name];","","  // view","  if (!view) {","    view = new View(name, {","      defaultEngine: this.get('view engine'),","      root: this.get('views'),","      engines: engines","    });","","    if (!view.path) {","      var err = new Error('Failed to lookup view \"' + name + '\"');","      err.view = view;","      return fn(err);","    }","","    // prime the cache","    if (opts.cache) cache[name] = view;","  }","","  // render","  try {","    view.render(opts, fn);","  } catch (err) {","    fn(err);","  }","};","","/**"," * Listen for connections."," *"," * A node `http.Server` is returned, with this"," * application (which is a `Function`) as its"," * callback. If you wish to create both an HTTP"," * and HTTPS server you may do so with the \"http\""," * and \"https\" modules as shown here:"," *"," *    var http = require('http')"," *      , https = require('https')"," *      , express = require('express')"," *      , app = express();"," *"," *    http.createServer(app).listen(80);"," *    https.createServer({ ... }, app).listen(443);"," *"," * @return {http.Server}"," * @api public"," */","","app.listen = function(){","  var server = http.createServer(this);","  return server.listen.apply(server, arguments);","};"];
