app.js
This file
Path
examples/app.js
58 lines · 1.0 KiB · JavaScript
Last changed by
Moving CommonLogger in sample app lower to catch Content-Lengthvisionmediabefore adoption45cd102
History of this fileTake it
The walk stopped after 200 commits: lines older than dd76816 point at it.
Added Collection#reject()visionmediabefore adoptiondd76816
line 1why, one step back1Cleaning up example appvisionmediabefore adoption05e9cc6
line 2why, one step back2require.paths.unshift('lib')Added Collection#reject()visionmediabefore adoptiondd76816
line 3why, one step back3require('express')Added plugins.js for quick plugin mixinsvisionmediabefore adoption39b0e43
line 4why, one step back4require('express/plugins')Added Collection#reject()visionmediabefore adoptiondd76816
line 5why, one step back5Defaulting views to <root>/viewsvisionmediabefore adoption84a7c51
line 6why, one step back6configure(function(){Cleaning up example appvisionmediabefore adoption05e9cc6
lines 7–8why, one step back7 use(MethodOverride)8 use(ContentLength)Moving CommonLogger in sample app lower to catch Content-Lengthvisionmediabefore adoption45cd102
line 9why, one step back9 use(CommonLogger)Defaulting views to <root>/viewsvisionmediabefore adoption84a7c51
line 10why, one step back10 set('root', dirname(__filename))Added "helpful 404" support pagevisionmediabefore adoption897c590
line 11why, one step back11 enable('helpful 404')Added "show exceptions" setting and specsvisionmediabefore adoptiondad297e
line 12why, one step back12 enable('show exceptions')Defaulting views to <root>/viewsvisionmediabefore adoption84a7c51
lines 13–15why, one step back13 enable('cache views')14})15Make route params request specificvisionmediabefore adoptiond0dae12
lines 16–18why, one step back16var messages = [],17 path = require('path'),18 posix = require('posix')Added chat example (though not practical over http)visionmediabefore adoption9c5552c
line 19why, one step back19CommonLogger showing "/" as rootvisionmediabefore adoption2b02305
line 20why, one step back20get('/', function(){Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764
line 21why, one step back21 this.redirect('/chat')CommonLogger showing "/" as rootvisionmediabefore adoption2b02305
lines 22–23why, one step back22})23Started chat examplevisionmediabefore adoption654c526
line 24why, one step back24get('/chat', function(){Moved render() to Requestvisionmediabefore adoptione182388
line 25why, one step back25 this.render('chat.haml.html', {Added chat example (though not practical over http)visionmediabefore adoption9c5552c
lines 26–29why, one step back26 locals: {27 messages: messages28 }29 })Cleaning up example appvisionmediabefore adoption05e9cc6
line 30why, one step back30})Added Collection#reject()visionmediabefore adoptiondd76816
line 31why, one step back31Added chat example (though not practical over http)visionmediabefore adoption9c5552c
line 32why, one step back32post('/chat', function(){Moved render() to Requestvisionmediabefore adoptione182388
line 33why, one step back33 messages.push(this.param('message'))Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764
line 34why, one step back34 this.halt(200)Added chat example (though not practical over http)visionmediabefore adoption9c5552c
lines 35–37why, one step back35})3637get('/chat/messages', function(){Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764
line 38why, one step back38 this.contentType('json')Added aliases of JSON.encode() and JSON.decode()visionmediabefore adoption0d9f502
line 39why, one step back39 return JSON.encode(messages)Added Collection#reject()visionmediabefore adoptiondd76816
lines 40–41why, one step back40})41Make route params request specificvisionmediabefore adoptiond0dae12
line 42why, one step back42get('/public/:file', function(file){Moved render() to Requestvisionmediabefore adoptione182388
lines 43–51why, one step back43 var self = this44 file = dirname(__filename) + '/public/' + file45 path.exists(file, function(exists){46 if (!exists) self.halt()47 posix.cat(file).addCallback(function(content){48 self.contentType(file)49 self.halt(200, content)50 })51 })More example app stylingvisionmediabefore adoptionbb2e79f
lines 52–53why, one step back52})53Started show exceptions supportvisionmediabefore adoptione728d3c
lines 54–57why, one step back54get('/error', function(){55 throw new Error('oh noes!')56})57Added Collection#reject()visionmediabefore adoptiondd76816
line 58why, one step back58run()