Skip to content
Myr

docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 8261437 · Browse files · 1 file+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−7 removed

  • other:+7 added−7 removed

1 file+7 added−7 removed

modified:lib/http.js+7 added-7 removed
49 unmodified lines
50 this.viewHelpers = {};51 this.dynamicViewHelpers = {};52 this.errorHandlers = [];5354 // Default "home" to / 54 // default "home" to / 55 this.set('home', '/');5657 // Set "env" to NODE_ENV, defaulting to "development"57 // set "env" to NODE_ENV, defaulting to "development"58 this.set('env', process.env.NODE_ENV || 'development');5960 // Expose objects to each other60 // expose objects to each other61 this.use(function(req, res, next){62 req.query = req.query || {};63 res.headers = { 'X-Powered-By': 'Express' };64 req.app = res.app = self;65 req.res = res;66 res.req = req;67 req.next = next;68 // Assign req.params.get68 // assign req.query69 if (req.url.indexOf('?') > 0) {70 var query = url.parse(req.url).query;71 req.query = qs.parse(query);72 }73 next();74 });7576 // Apply middleware76 // apply middleware77 if (middleware) {78 middleware.forEach(function(fn){79 self.use(fn);80 });81 }8283 // Use router, expose as app.get(), etc83 // use router, expose as app.get(), etc84 var fn = router(function(app){ self.routes = app; });85 this.__defineGetter__('router', function(){86 this.__usedRouter = true;87 return fn;88 });8990 // Default production configuration90 // default production configuration91 this.configure('production', function(){92 this.enable('cache views');93 });94};
369 unmodified lines