[Groonga-commit] droonga/express-droonga at 785c1aa [master] Migrate codes for express 4.0

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Apr 21 20:05:29 JST 2014


YUKI Hiroshi	2014-04-21 20:05:29 +0900 (Mon, 21 Apr 2014)

  New Revision: 785c1aa3dcf4bc07de726df80087d733c6edf4ce
  https://github.com/droonga/express-droonga/commit/785c1aa3dcf4bc07de726df80087d733c6edf4ce

  Message:
    Migrate codes for express 4.0

  Modified files:
    lib/ui/dashboard.js
    package.json

  Modified: lib/ui/dashboard.js (+10 -5)
===================================================================
--- lib/ui/dashboard.js    2014-04-21 19:58:45 +0900 (cfcac19)
+++ lib/ui/dashboard.js    2014-04-21 20:05:29 +0900 (78d25d4)
@@ -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');
 
@@ -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) {

  Modified: package.json (+6 -1)
===================================================================
--- package.json    2014-04-21 19:58:45 +0900 (5e06f29)
+++ package.json    2014-04-21 20:05:29 +0900 (1d0009c)
@@ -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",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index