diff --git a/app.js b/app.js index 4d2267e..b336dee 100644 --- a/app.js +++ b/app.js @@ -6,30 +6,31 @@ var express = require('express') , stylus = require('stylus') , redis = require('redis') - , http = require('http'); + , http = require('http') + , logger = require('morgan') + , errorHandler = require('errorhandler'); app = express(); -app.configure(function(){ - app.db = redis.createClient(); - app.set('views', __dirname + '/views'); - app.set('view engine', 'jade'); - app.set('phantom', 'phantomjs'); - app.set('screenshots', '/tmp'); - app.set('default viewport width', 1024); - app.set('default viewport height', 600); - app.set('colors', 3); - app.set('root', __dirname); - app.use(express.favicon()); - app.use(express.logger('dev')); - app.use(stylus.middleware({ src: __dirname + '/public' })); - app.use(express.static(__dirname + '/public')); - app.use(app.router); -}); - -app.configure('development', function(){ - app.use(express.errorHandler()); -}); + +app.db = redis.createClient(); +app.set('views', __dirname + '/views'); +app.set('view engine', 'jade'); +app.set('phantom', 'phantomjs'); +app.set('screenshots', '/tmp'); +app.set('default viewport width', 1024); +app.set('default viewport height', 600); +app.set('colors', 3); +app.set('root', __dirname); +app.use(logger('dev')); +app.use(stylus.middleware({ src: __dirname + '/public' })); +app.use(express.static(__dirname + '/public')); + + + + +app.use(errorHandler()); + require('./routes'); diff --git a/package.json b/package.json index 54767c7..cabd4a2 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,11 @@ "express": "https://github.com/visionmedia/express/tarball/master" , "jade": "*" , "palette": "*" + , "morgan": "*" + , "errorhandler": "*" , "redis": "0.7.x" , "canvas": "~1.1.2" , "stylus": "0.21.x" , "phantomjs": "~1.9.2" } -} \ No newline at end of file +}