app.js
This file
Path
examples/upload/app.js
42 lines · 774 bytes · JavaScript
Last changed by
Merge branch 'flip-views'visionmediabefore adoption6b13fc9
History of this fileTake it
The walk stopped after 200 commits: lines older than b333dcc point at it.
Hooks (before / after) pass request as argvisionmediabefore adoptionb333dcc
lines 1–8why, one step back12require.paths.unshift('lib')3require('express')4require('express/plugins')56configure(function(){7 use(MethodOverride)8 use(ContentLength)Merge branch 'flash'visionmediabefore adoptione351a02
lines 9–11why, one step back9 use(Cookie)10 use(Session)11 use(Flash)"common" Logger format using printf()visionmediabefore adoptiona2ec966
line 12why, one step back12 use(Logger)Both example apps now use Staticvisionmediabefore adoption3721873
line 13why, one step back13 use(Static)Hooks (before / after) pass request as argvisionmediabefore adoptionb333dcc
line 14why, one step back14 set('root', __dirname)Merge branch 'upload-limit'visionmediabefore adoption56ffe1d
line 15why, one step back15 set('max upload size', (5).megabytes)Hooks (before / after) pass request as argvisionmediabefore adoptionb333dcc
lines 16–22why, one step back16})1718get('/', function(){19 this.redirect('/upload')20})2122get('/upload', function(){Merge branch 'flip-views'visionmediabefore adoption6b13fc9
line 23why, one step back23 this.render('upload.html.haml', {Merge branch 'flash'visionmediabefore adoptione351a02
lines 24–27why, one step back24 locals: {25 flashes: this.flash('info')26 } 27 })Hooks (before / after) pass request as argvisionmediabefore adoptionb333dcc
lines 28–29why, one step back28})29Merge branch 'node-0.1.30'visionmediabefore adoptionf7d7c4a
line 30why, one step back30post('/upload', function(){ Merge branch 'ext'visionmediabefore adoption364c131
line 31why, one step back31 this.param('images').each(function(image){Merge branch 'flash'visionmediabefore adoptione351a02
line 32why, one step back32 puts(image.filename + ' -> ' + image.tempfile)Merge branch 'ext'visionmediabefore adoption364c131
lines 33–34why, one step back33 this.flash('info', 'Uploaded ' + image.filename)34 }, this)Hooks (before / after) pass request as argvisionmediabefore adoptionb333dcc
lines 35–38why, one step back35 this.redirect('/upload')36})3738get('/*.css', function(file){Merge branch 'flip-views'visionmediabefore adoption6b13fc9
line 39why, one step back39 this.render(file + '.css.sass', { layout: false })Hooks (before / after) pass request as argvisionmediabefore adoptionb333dcc
lines 40–42why, one step back40})4142run()