Navigation Menu

Skip to content

Commit

Permalink
Migrate codes for express 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 21, 2014
1 parent 0a50cc7 commit 785c1aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
15 changes: 10 additions & 5 deletions lib/ui/dashboard.js
@@ -1,4 +1,9 @@
var express = require('express');
var favicon = require('static-favicon');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var serveStatic = require('serve-static');
var errorhandler = require('errorhandler');
var less = require('less-middleware');
var path = require('path');

Expand All @@ -12,15 +17,15 @@ exports.register = function(application, params) {

application.set('views', path.join(topDirectory, 'views'));
application.set('view engine', 'jade');
application.use(prefix, express.favicon());
application.use(prefix, express.bodyParser());
application.use(prefix, express.methodOverride());
application.use(prefix, favicon());
application.use(prefix, bodyParser());
application.use(prefix, methodOverride());
application.use(prefix, less(path.join(topDirectory, 'public')));
application.use(prefix, express.static(path.join(topDirectory, 'public')));
application.use(prefix, serveStatic(path.join(topDirectory, 'public')));

var env = process.env.NODE_ENV || 'development';
if (env == 'development') {
application.use(prefix, express.errorHandler());
application.use(prefix, errorhandler());
}

application.get(prefix + '/dashboard', function(request, response) {
Expand Down
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -19,14 +19,19 @@
},
"license": "MIT",
"dependencies": {
"body-parser": "*",
"connect": "*",
"errorhandler": "*",
"fluent-logger": "*",
"inflection": "*",
"jade": "*",
"less-middleware": ">=0.2",
"uber-cache": "*",
"method-override": "*",
"msgpack": "*",
"socket.io": "*"
"serve-static": "*",
"socket.io": "*",
"static-favicon": "*"
},
"devDependencies": {
"express": ">=4.0",
Expand Down

0 comments on commit 785c1aa

Please sign in to comment.