Skip to content
Myr

application.js

This file

Path

lib/application.js

563 lines · 11.7 KiB · JavaScript

Last changed by

Added: emit "mount" event on the app being mountedTj Holowaychukbefore adoptionb6611c8

History of this file

Take it

The walk stopped after 200 commits: lines older than d1ce4c9 point at it.

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 1–14why, one step back
1
2/*!3 * Express - proto4 * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>5 * MIT Licensed6 */78/**9 * Module dependencies.10 */1112var connect = require('connect')13 , Router = require('./router')14 , methods = Router.methods.concat('del', 'all')

refactored init middleware into its own fileTj Holowaychukbefore adoption4c316ba

line 15why, one step back
15 , middleware = require('./middleware')

new ViewTj Holowaychukbefore adoptione1da383

line 16why, one step back
16 , View = require('./view')

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 17–19why, one step back
17 , url = require('url')
18 , utils = connect.utils19 , path = require('path')

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 20why, one step back
20 , http = require('http')

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 21–33why, one step back
21 , join = path.join
22 , fs = require('fs')23 , qs = require('qs');2425/**26 * Expose `HTTPServer`.27 */2829var app = exports = module.exports = {};3031/**32 * Initialize the server.33 *

refactoring boot logicTj Holowaychukbefore adoption8848004

lines 34–37why, one step back
34 * - setup default configuration
35 * - setup default middleware36 * - setup route reflection methods37 *

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 38–40why, one step back
38 * @api private
39 */40

refactoring boot logicTj Holowaychukbefore adoption8848004

line 41why, one step back
41app.init = function(){

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 42why, one step back
42 var self = this;

app.lookup()Tj Holowaychukbefore adoption76b7d69

line 43why, one step back
43 this.cache = {};

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 44–47why, one step back
44 this.settings = {};
45 this.engines = {};46 this.redirects = {};47 this.isCallbacks = {};

app.locals.use(fn)Tj Holowaychukbefore adoption0f6ad43

line 48why, one step back
48 this.viewCallbacks = [];

refactoring boot logicTj Holowaychukbefore adoption8848004

line 49why, one step back
49 this.defaultConfiguration();

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 50why, one step back
50

miscTj Holowaychukbefore adoptiond4b08e9

line 51why, one step back
51 // route reflection methods

refactoring boot logicTj Holowaychukbefore adoption8848004

lines 52–53why, one step back
52 methods.forEach(function(method){
53 self.lookup[method] = function(path){

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 54why, one step back
54 return self._router.lookup(method, path);

refactoring boot logicTj Holowaychukbefore adoption8848004

lines 55–57why, one step back
55 };
5657 self.match[method] = function(path){

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 58why, one step back
58 return self._router.match(method, path);

refactoring boot logicTj Holowaychukbefore adoption8848004

lines 59–61why, one step back
59 };
6061 self.remove[method] = function(path){

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 62why, one step back
62 return self._router.lookup(method, path).remove();

refactoring boot logicTj Holowaychukbefore adoption8848004

lines 63–80why, one step back
63 };
64 });6566 // del -> delete67 self.lookup.del = self.lookup.delete;68 self.match.del = self.match.delete;69 self.remove.del = self.remove.delete;70};7172/**73 * Initialize application configuration.74 *75 * @api private76 */7778app.defaultConfiguration = function(){79 var self = this;80

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 81why, one step back
81 // default settings

Fixed res.clearCookie(), default path to "root" settingTj Holowaychukbefore adoption0f2f3d4

line 82why, one step back
82 this.set('root', '/');

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 83–84why, one step back
83 this.set('env', process.env.NODE_ENV || 'development');
84

refactored init middleware into its own fileTj Holowaychukbefore adoption4c316ba

line 85why, one step back
85 // implicit middleware

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 86why, one step back
86 this.use(connect.query());

refactored init middleware into its own fileTj Holowaychukbefore adoption4c316ba

line 87why, one step back
87 this.use(middleware.init(this));

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 88why, one step back
88

docsTj Holowaychukbefore adoption6ae32fd

line 89why, one step back
89 // app locals

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 90why, one step back
90 this.locals = function(obj){

misc refactoringTj Holowaychukbefore adoption4ed92d5

line 91why, one step back
91 for (var key in obj) self.locals[key] = obj[key];

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 92why, one step back
92 return self;

app.locals.use(fn)Tj Holowaychukbefore adoption0f6ad43

lines 93–94why, one step back
93 };
94

docsTj Holowaychukbefore adoption6ae32fd

line 95why, one step back
95 // response locals

app.locals.use(fn)Tj Holowaychukbefore adoption0f6ad43

line 96why, one step back
96 this.locals.use = function(fn){

added sync signature for app.locals.use()Tj Holowaychukbefore adoption965e1d6

lines 97–104why, one step back
97 if (3 == fn.length) {
98 self.viewCallbacks.push(fn);99 } else {100 self.viewCallbacks.push(function(req, res, done){101 fn(req, res);102 done();103 });104 }

app.locals.use(fn)Tj Holowaychukbefore adoption0f6ad43

line 105why, one step back
105 return this;

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 106–109why, one step back
106 };
107108109 // router

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

lines 110–111why, one step back
110 this._router = new Router(this);
111 this.routes = this._router.routes;

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 112why, one step back
112 this.__defineGetter__('router', function(){

fixed auto use(app.router)Tj Holowaychukbefore adoption92c5284

line 113why, one step back
113 this._usedRouter = true;

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 114why, one step back
114 return self._router.middleware;

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 115–134why, one step back
115 });
116117 // default locals118 this.locals.settings = this.settings;119120 // default production configuration121 this.configure('production', function(){122 this.enable('view cache');123 });124};125126/**127 * Remove routes matching the given `path`.128 *129 * @param {Route} path130 * @return {Boolean}131 * @api public132 */133134app.remove = function(path){

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 135why, one step back
135 return this._router.lookup('all', path).remove();

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 136–147why, one step back
136};
137138/**139 * Lookup routes defined with a path140 * equivalent to `path`.141 *142 * @param {Stirng} path143 * @return {Array}144 * @api public145 */146147app.lookup = function(path){

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 148why, one step back
148 return this._router.lookup('all', path);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 149–159why, one step back
149};
150151/**152 * Lookup routes matching the given `url`.153 *154 * @param {Stirng} url155 * @return {Array}156 * @api public157 */158159app.match = function(url){

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 160why, one step back
160 return this._router.match('all', url);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 161–163why, one step back
161};
162163/**

docsTj Holowaychukbefore adoption2e22887

line 164why, one step back
164 * Proxy `connect#use()` to apply settings to

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 165–167why, one step back
165 * mounted applications.
166 *167 * @param {String|Function|Server} route

misc refactoringTj Holowaychukbefore adoption1334a74

line 168why, one step back
168 * @param {Function|Server} fn

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 169why, one step back
169 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 170–172why, one step back
170 * @api public
171 */172

misc refactoringTj Holowaychukbefore adoption1334a74

line 173why, one step back
173app.use = function(route, fn){

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 174–175why, one step back
174 var app, home, handle;
175

misc refactoringTj Holowaychukbefore adoption1334a74

line 176why, one step back
176 if ('string' != typeof route) fn = route, route = '/';

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 177–178why, one step back
177
178 // express app

misc refactoringTj Holowaychukbefore adoption1334a74

line 179why, one step back
179 if (fn.handle && fn.set) app = fn;

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 180–183why, one step back
180
181 // restore .app property on req and res182 if (app) {183 app.route = route;

misc refactoringTj Holowaychukbefore adoption1334a74

line 184why, one step back
184 fn = function(req, res, next) {

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 185–192why, one step back
185 var orig = req.app;
186 app.handle(req, res, function(err){187 req.app = res.app = orig;188 next(err);189 });190 };191 }192

misc refactoringTj Holowaychukbefore adoption1334a74

line 193why, one step back
193 connect.proto.use.call(this, route, fn);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 194–197why, one step back
194
195 // mounted an app, invoke the hook196 // and adjust some settings197 if (app) {

tweak res.redirect() mount route logicTj Holowaychukbefore adoption43d9f6e

lines 198–201why, one step back
198 var root = this.get('root') || this.route;
199 if ('/' == root) root = '';200 root = root + (app.get('root') || app.route);201 app.set('root', root);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 202why, one step back
202 app.parent = this;

Added: emit "mount" event on the app being mountedTj Holowaychukbefore adoptionb6611c8

line 203why, one step back
203 app.emit('mount', this);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 204–213why, one step back
204 }
205206 return this;207};208209/**210 * Register the given template engine callback `fn`211 * as `ext`. For example we may wish to map ".html"212 * files to ejs rather than using the ".ejs" extension.213 *

Added app.engine() testsTj Holowaychukbefore adoption66f8ca5

line 214why, one step back
214 * app.engine('.html', require('ejs').render);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 215–217why, one step back
215 *
216 * or217 *

Added app.engine() testsTj Holowaychukbefore adoption66f8ca5

line 218why, one step back
218 * app.engine('html', require('ejs').render);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 219–221why, one step back
219 *
220 * @param {String} ext221 * @param {Function} fn

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 222why, one step back
222 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 223–225why, one step back
223 * @api public
224 */225

Added app.engine() testsTj Holowaychukbefore adoption66f8ca5

line 226why, one step back
226app.engine = function(ext, fn){

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 227–286why, one step back
227 if ('.' != ext[0]) ext = '.' + ext;
228 this.engines[ext] = fn;229 return this;230};231232/**233 * Map the given param placeholder `name`(s) to the given callback(s).234 *235 * Param mapping is used to provide pre-conditions to routes236 * which us normalized placeholders. This callback has the same237 * signature as regular middleware, for example below when ":userId"238 * is used this function will be invoked in an attempt to load the user.239 *240 * app.param('userId', function(req, res, next, id){241 * User.find(id, function(err, user){242 * if (err) {243 * next(err);244 * } else if (user) {245 * req.user = user;246 * next();247 * } else {248 * next(new Error('failed to load user'));249 * }250 * });251 * });252 *253 * Passing a single function allows you to map logic254 * to the values passed to `app.param()`, for example255 * this is useful to provide coercion support in a concise manner.256 *257 * The following example maps regular expressions to param values258 * ensuring that they match, otherwise passing control to the next259 * route:260 *261 * app.param(function(name, regexp){262 * if (regexp instanceof RegExp) {263 * return function(req, res, next, val){264 * var captures;265 * if (captures = regexp.exec(String(val))) {266 * req.params[name] = captures;267 * next();268 * } else {269 * next('route');270 * }271 * }272 * }273 * });274 *275 * We can now use it as shown below, where "/commit/:commit" expects276 * that the value for ":commit" is at 5 or more digits. The capture277 * groups are then available as `req.params.commit` as we defined278 * in the function above.279 *280 * app.param('commit', /^\d{5,}$/);281 *282 * For more of this useful functionality take a look283 * at [express-params](http://github.com/visionmedia/express-params).284 *285 * @param {String|Array|Function} name286 * @param {Function} fn

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 287why, one step back
287 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 288–303why, one step back
288 * @api public
289 */290291app.param = function(name, fn){292 var self = this293 , fns = [].slice.call(arguments, 1);294295 // array296 if (Array.isArray(name)) {297 name.forEach(function(name){298 fns.forEach(function(fn){299 self.param(name, fn);300 });301 });302 // param logic303 } else if ('function' == typeof name) {

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 304why, one step back
304 this._router.param(name);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 305–308why, one step back
305 // single
306 } else {307 if (':' == name[0]) name = name.substr(1);308 fns.forEach(function(fn){

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 309why, one step back
309 self._router.param(name, fn);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 310–320why, one step back
310 });
311 }312313 return this;314};315316/**317 * Register the given callback `fn` for the given `type`.318 *319 * @param {String} type320 * @param {Function} fn

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 321why, one step back
321 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 322–381why, one step back
322 * @api public
323 */324325app.is = function(type, fn){326 if (!fn) return this.isCallbacks[type];327 this.isCallbacks[type] = fn;328 return this;329};330331/**332 * Assign `setting` to `val`, or return `setting`'s value.333 * Mounted servers inherit their parent server's settings.334 *335 * @param {String} setting336 * @param {String} val337 * @return {Server|Mixed} for chaining, or the setting value338 * @api public339 */340341app.set = function(setting, val){342 if (val === undefined) {343 if (this.settings.hasOwnProperty(setting)) {344 return this.settings[setting];345 } else if (this.parent) {346 return this.parent.set(setting);347 }348 } else {349 this.settings[setting] = val;350 return this;351 }352};353354/**355 * Check if `setting` is enabled.356 *357 * @param {String} setting358 * @return {Boolean}359 * @api public360 */361362app.enabled = function(setting){363 return !!this.set(setting);364};365366/**367 * Check if `setting` is disabled.368 *369 * @param {String} setting370 * @return {Boolean}371 * @api public372 */373374app.disabled = function(setting){375 return !this.set(setting);376};377378/**379 * Enable `setting`.380 *381 * @param {String} setting

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 382why, one step back
382 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 383–393why, one step back
383 * @api public
384 */385386app.enable = function(setting){387 return this.set(setting, true);388};389390/**391 * Disable `setting`.392 *393 * @param {String} setting

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 394why, one step back
394 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 395–406why, one step back
395 * @api public
396 */397398app.disable = function(setting){399 return this.set(setting, false);400};401402/**403 * Redirect `key` to `url`.404 *405 * @param {String} key406 * @param {String} url

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 407why, one step back
407 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 408–437why, one step back
408 * @api public
409 */410411app.redirect = function(key, url){412 this.redirects[key] = url;413 return this;414};415416/**417 * Configure callback for zero or more envs,418 * when no env is specified that callback will419 * be invoked for all environments. Any combination420 * can be used multiple times, in any order desired.421 *422 * Examples:423 *424 * app.configure(function(){425 * // executed for all envs426 * });427 *428 * app.configure('stage', function(){429 * // executed staging env430 * });431 *432 * app.configure('stage', 'production', function(){433 * // executed for stage and production434 * });435 *436 * @param {String} env...437 * @param {Function} fn

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 438why, one step back
438 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 439–443why, one step back
439 * @api public
440 */441442app.configure = function(env, fn){443 var envs = 'all'

Removed toArray() utilTj Holowaychukbefore adoption7a7d77e

line 444why, one step back
444 , args = [].slice.call(arguments);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 445–451why, one step back
445 fn = args.pop();
446 if (args.length) envs = args;447 if ('all' == envs || ~envs.indexOf(this.settings.env)) fn.call(this);448 return this;449};450451/**

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

lines 452–466why, one step back
452 * Listen for connections.
453 *454 * This method takes the same arguments455 * as node's `http.Server#listen()`. 456 *457 * @return {http.Server}458 * @api public459 */460461app.listen = function(){462 var server = http.createServer(this);463 return server.listen.apply(server, arguments);464};465466/**

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 467–471why, one step back
467 * Delegate `.VERB(...)` calls to `.route(VERB, ...)`.
468 */469470methods.forEach(function(method){471 app[method] = function(path){

Added `app.get(setting)`. Closes #842Tj Holowaychukbefore adoptione0bd0d6

line 472why, one step back
472 if ('get' == method && 1 == arguments.length) return this.set(path);

Removed toArray() utilTj Holowaychukbefore adoption7a7d77e

line 473why, one step back
473 var args = [method].concat([].slice.call(arguments));

fixed auto use(app.router)Tj Holowaychukbefore adoption92c5284

line 474why, one step back
474 if (!this._usedRouter) this.use(this.router);

Added `app.routes`, replacing `app.routes.all()`. Closes #811Tj Holowaychukbefore adoption62257bc

line 475why, one step back
475 return this._router._route.apply(this._router, args);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 476–484why, one step back
476 }
477});478479/**480 * Special-cased "all" method, applying the given route `path`,481 * middleware, and callback to _every_ HTTP method.482 *483 * @param {String} path484 * @param {Function} ...

Added app.listen() as a shortcut for http.createServer(app).listen()Tj Holowaychukbefore adoption9082e74

line 485why, one step back
485 * @return {app} for chaining

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 486–502why, one step back
486 * @api public
487 */488489app.all = function(path){490 var args = arguments;491 methods.forEach(function(method){492 if ('all' == method) return;493 app[method].apply(this, args);494 }, this);495 return this;496};497498// del -> delete alias499500app.del = app.delete;501502/**

new ViewTj Holowaychukbefore adoptione1da383

line 503why, one step back
503 * Render the given view `name` name with `options`

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 504–506why, one step back
504 * and a callback accepting an error and the
505 * rendered template string.506 *

new ViewTj Holowaychukbefore adoptione1da383

line 507why, one step back
507 * @param {String} name

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 508–512why, one step back
508 * @param {String|Function} options or fn
509 * @param {Function} fn510 * @api public511 */512

new ViewTj Holowaychukbefore adoptione1da383

line 513why, one step back
513app.render = function(name, options, fn){

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 514–515why, one step back
514 var self = this
515 , opts = {}

re-implemented "view cache"Tj Holowaychukbefore adoption8a38211

line 516why, one step back
516 , cache = this.cache

new ViewTj Holowaychukbefore adoptione1da383

lines 517–518why, one step back
517 , engines = this.engines
518 , view;

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 519–536why, one step back
519
520 // support callback function as second arg521 if ('function' == typeof options) {522 fn = options, options = {};523 }524525 // merge app.locals526 utils.merge(opts, this.locals);527528 // merge options.locals529 if (options.locals) {530 utils.merge(opts, options.locals);531 delete opts.locals;532 }533534 // merge options535 utils.merge(opts, options);536

new ViewTj Holowaychukbefore adoptione1da383

lines 537–540why, one step back
537 // set .cache unless explicitly provided
538 opts.cache = null == opts.cache539 ? this.enabled('view cache')540 : opts.cache;

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 541why, one step back
541

new ViewTj Holowaychukbefore adoptione1da383

lines 542–543why, one step back
542 // primed cache
543 if (opts.cache) view = cache[name];

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 544why, one step back
544

new ViewTj Holowaychukbefore adoptione1da383

lines 545–547why, one step back
545 // view
546 if (!view) {547 view = new View(name, {

Fixed app.render() absolute path supportTj Holowaychukbefore adoptionb9dee73

lines 548–549why, one step back
548 defaultEngine: this.get('view engine')
549 , root: this.get('views') || process.cwd() + '/views'

new ViewTj Holowaychukbefore adoptione1da383

lines 550–551why, one step back
550 , engines: engines
551 });

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

line 552why, one step back
552

new ViewTj Holowaychukbefore adoptione1da383

lines 553–556why, one step back
553 // prime the cache
554 if (opts.cache) cache[name] = view;555 }556

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 557–558why, one step back
557 // render
558 try {

new ViewTj Holowaychukbefore adoptione1da383

line 559why, one step back
559 view.render(opts, fn);

req.query is always presentTj Holowaychukbefore adoptiond1ce4c9

lines 560–563why, one step back
560 } catch (err) {
561 fn(err);562 }563};