
/**
 * Module dependencies.
 */

var express = require('express'),
    engine = require('ejs-locals'),
    db = require('./db'),
    home = require('./routes'),
    about = require('./routes/about'),
    todo = require('./routes/todo'),
    threejs = require('./routes/threejs'),
    http = require('http'),
    path = require('path');

var app = express();

// use ejs-locals for all ejs templates
app.engine('ejs', engine);

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser('secret'));
app.use(express.session());
app.use('/todo', todo.current_user);
app.use(app.router);
app.use(require('stylus').middleware(__dirname + '/public'));
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', home.index);
app.get('/about', about.index);
app.get('/threejs', threejs.index);

// Todo list
app.get('/todo', todo.index);
app.post('/todo/add', todo.add);
app.get('/todo/edit/:id', todo.index);
app.post('/todo/edit/:id', todo.edit);
app.get('/todo/delete/:id', todo.destroy);

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});
@@ -441,16 +441,46 @@
 onments%0A
+app.configure(function()%7B%0A    
 app.set(
@@ -514,16 +514,20 @@
  3000);%0A
+    
 app.set(
@@ -554,24 +554,28 @@
  '/views');%0A
+    
 app.set('vie
@@ -593,16 +593,20 @@
 'ejs');%0A
+    
 app.use(
@@ -621,24 +621,28 @@
 favicon());%0A
+    
 app.use(expr
@@ -657,24 +657,28 @@
 er('dev'));%0A
+    
 app.use(expr
@@ -692,24 +692,28 @@
 yParser());%0A
+    
 app.use(expr
@@ -731,24 +731,28 @@
 verride());%0A
+    
 app.use(expr
@@ -776,24 +776,28 @@
 'secret'));%0A
+    
 app.use(expr
@@ -808,24 +808,28 @@
 session());%0A
+    
 app.use('/to
@@ -849,24 +849,28 @@
 rent_user);%0A
+    
 app.use(app.
@@ -878,16 +878,20 @@
 outer);%0A
+    
 app.use(
@@ -944,16 +944,20 @@
 lic'));%0A
+    
 app.use(
@@ -1004,16 +1004,20 @@
 lic')));
+%0A%7D);
 %0A%0A// dev
@@ -1034,11 +1034,21 @@
 nly%0A
-if 
+app.configure
 ('de
@@ -1061,32 +1061,26 @@
 ent'
- == app.get('env')) 
+, function()
 %7B%0A  
+ 
+ 
 app.
@@ -1109,16 +1109,87 @@
 er());%0A%7D
+);%0A%0A// production%0Aapp.configure('production', function()%7B%0A    //...%0A%7D);
 %0A%0Aapp.ge

Change configuration settings