Skip to content
Myr

Fixed host

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

authored by visionmedia · committed by visionmedia · parent cab9581 · Browse files · 1 file+4 added−37 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+4 added−37 removed

  • other:+4 added−37 removed

1 file+4 added−37 removed

modified:lib/express.core.js+4 added-37 removed
86 unmodified lines
87 * @api public88 */89 90 start : function(port, host) {91 this.server.listen(port || 3000, function(request, response){91 this.server.listen(port || 3000, host, function(request, response){92 Express.response.body = null93 Express.response.status = 20094 Express.request = request95 request.headers = Express.arrayToHash(request.headers)
491 unmodified lines
587})()588589use('response', Express.Logger)590591get('user/:name/:operation', function(){592 p(request.headers['User-Agent'])593 p(request.headers['Accept'])594 p(request.headers['Accept-Encoding'])595 p(request.headers['Cookie'])596 p(request.cookie)597 param('operation') + 'ing ' + param('name')591get('/user/:name', function(){592 593 'User ' + param('name')594})595600get('cookies', function(){601 cookie('foo', 'bar')602 cookie('some-thing', 'some value')603 cookie('max-age', '1000')604 p(request.headers)605 p(response.headers)606 'Wahoo!'607})608609get('articles', function(){610 display('spec/data/example.html.js')611 'list of articles'612})613614get(/articles\/(\d+)/, function(){615 redirect('http://google.com') // TODO: remove / fix616 header('Content-Type', 'text/html')617 'article id ' + captures[1]618})619620get('articles/:name', function(){621 if (param('name') == 'tj') {622 respond('Halted execution')623 'hello tj'624 }625 else626 'article name ' + param('name')627})628596Express.start()