app.js
This file
Path
examples/upload/app.js
44 lines · 804 bytes · JavaScript
Last changed by
Merge branch 'globals'visionmediabefore adoption8b58732
History of this fileTake it
The walk stopped after 200 commits: lines older than 3863a76 point at it.
Merge branch 'flash'visionmediabefore adoption3863a76
lines 1–5why, one step back12require.paths.unshift('lib')3require('express')4require('express/plugins')5Merge branch 'globals'visionmediabefore adoption8b58732
lines 6–7why, one step back6var sys = require('sys')7Merge branch 'flash'visionmediabefore adoption3863a76
lines 8–10why, one step back8configure(function(){9 use(MethodOverride)10 use(ContentLength)Merge branch 'flash'visionmediabefore adoptione351a02
lines 11–13why, one step back11 use(Cookie)12 use(Session)13 use(Flash)"common" Logger format using printf()visionmediabefore adoptiona2ec966
line 14why, one step back14 use(Logger)Both example apps now use Staticvisionmediabefore adoption3721873
line 15why, one step back15 use(Static)Merge branch 'flash'visionmediabefore adoption3863a76
line 16why, one step back16 set('root', __dirname)Merge branch 'upload-limit'visionmediabefore adoption56ffe1d
line 17why, one step back17 set('max upload size', (5).megabytes)Merge branch 'flash'visionmediabefore adoption3863a76
lines 18–24why, one step back18})1920get('/', function(){21 this.redirect('/upload')22})2324get('/upload', function(){Merge branch 'flip-views'visionmediabefore adoption6b13fc9
line 25why, one step back25 this.render('upload.html.haml', {Merge branch 'flash'visionmediabefore adoptione351a02
lines 26–29why, one step back26 locals: {27 flashes: this.flash('info')28 } 29 })Merge branch 'flash'visionmediabefore adoption3863a76
lines 30–31why, one step back30})31Merge branch 'node-0.1.30'visionmediabefore adoptionf7d7c4a
line 32why, one step back32post('/upload', function(){ Merge branch 'ext'visionmediabefore adoption364c131
line 33why, one step back33 this.param('images').each(function(image){Merge branch 'globals'visionmediabefore adoption8b58732
line 34why, one step back34 sys.puts(image.filename + ' -> ' + image.tempfile)Merge branch 'ext'visionmediabefore adoption364c131
lines 35–36why, one step back35 this.flash('info', 'Uploaded ' + image.filename)36 }, this)Merge branch 'flash'visionmediabefore adoption3863a76
lines 37–40why, one step back37 this.redirect('/upload')38})3940get('/*.css', function(file){Merge branch 'flip-views'visionmediabefore adoption6b13fc9
line 41why, one step back41 this.render(file + '.css.sass', { layout: false })Merge branch 'flash'visionmediabefore adoption3863a76
lines 42–44why, one step back42})4344run()