app.js
This file
Path
examples/upload/app.js
44 lines · 810 bytes · JavaScript
Last changed by
Merge branch 'master' of git://github.com/visionmedia/express into async_pluginsciaranjbefore adoption27ff134
History of this fileTake it
Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 1–9why, one step back12require.paths.unshift('lib')3require('express')4require('express/plugins')56configure(function(){7 use(MethodOverride)8 use(ContentLength)9 use(CommonLogger)Merge branch 'flash'visionmediabefore adoptione351a02
lines 10–12why, one step back10 use(Cookie)11 use(Session)12 use(Flash)Mergevisionmediabefore adoptioncec6770
line 13why, one step back13 set('root', __dirname)Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 14–20why, one step back14})1516get('/', function(){17 this.redirect('/upload')18})1920get('/upload', function(){Merge branch 'flash'visionmediabefore adoptione351a02
lines 21–25why, one step back21 this.render('upload.haml.html', {22 locals: {23 flashes: this.flash('info')24 } 25 })Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 26–27why, one step back26})27Merge branch 'node-0.1.30'visionmediabefore adoptionf7d7c4a
line 28why, one step back28post('/upload', function(){ Merge branch 'master' of git://github.com/visionmedia/express into async_pluginsciaranjbefore adoption27ff134
line 29why, one step back29 this.param('images').each(function(image){Merge branch 'flash'visionmediabefore adoptione351a02
line 30why, one step back30 puts(image.filename + ' -> ' + image.tempfile)Merge branch 'master' of git://github.com/visionmedia/express into async_pluginsciaranjbefore adoption27ff134
lines 31–32why, one step back31 this.flash('info', 'Uploaded ' + image.filename)32 }, this)Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 33–36why, one step back33 this.redirect('/upload')34})3536get('/public/*', function(file){Mergevisionmediabefore adoptioncec6770
line 37why, one step back37 this.sendfile(__dirname + '/public/' + file)Merge branch 'master' of git://github.com/visionmedia/expressciaranjbefore adoption046bee8
lines 38–44why, one step back38})3940get('/*.css', function(file){41 this.render(file + '.sass.css', { layout: false })42})4344run()