Browse Source

Merge pull request #2163 from knewmanTE/upgrade-other-nodejs-frameworks

Upgrade nodeJS to 6.3.0
Nate 9 years ago
parent
commit
b593a33e62

+ 14 - 9
frameworks/JavaScript/express/app.js

@@ -107,7 +107,7 @@ if (cluster.isMaster) {
   app.get('/plaintext', function(req, res) {
     res.header('Content-Type', 'text/plain').send('Hello, World!');
   });
-  
+
   app.get('/mongoose', function(req, res) {
     var queries = isNaN(req.query.queries) ? 1 : parseInt(req.query.queries, 10)
       , queryFunctions = [];
@@ -128,8 +128,9 @@ if (cluster.isMaster) {
     });
   });
 
-  app.get('/mysql-orm', function(req, res) {    
-    var queries = isNaN(req.query.queries) ? 1 : parseInt(req.query.queries, 10)
+  app.get('/mysql-orm', function(req, res) {
+    var queriesRaw = parseInt(req.query.queries, 10)
+      , queries = isNaN(queriesRaw) ? 1 : queriesRaw
       , queryFunctions = [];
 
     queries = Math.min(Math.max(queries, 1), 500);
@@ -140,12 +141,14 @@ if (cluster.isMaster) {
           where: {
             id: Math.floor(Math.random() * 10000) + 1}
           }
-        ).complete(callback);
+        ).then(function(world) {
+            callback(null, world);
+        });
       });
     }
 
     async.parallel(queryFunctions, function(err, results) {
-      if (!req.query.queries) {
+      if (req.query.queries == undefined) {
         results = results[0];
       }
       res.setHeader("Content-Type", "application/json");
@@ -154,7 +157,7 @@ if (cluster.isMaster) {
   });
 
   app.get('/fortune', function(req, res) {
-    Fortune.findAll().complete(function (err, fortunes) {
+    Fortune.findAll().then(function (fortunes) {
       var newFortune = {id: 0, message: "Additional fortune added at request time."};
       fortunes.push(newFortune);
       fortunes.sort(function (a, b) {
@@ -211,7 +214,9 @@ if (cluster.isMaster) {
           where: {
             id: Math.floor(Math.random() * 10000) + 1}
           }
-        ).complete(callback);
+        ).then(function(world) {
+          callback(null, world);
+        });
       });
     }
 
@@ -222,7 +227,7 @@ if (cluster.isMaster) {
         (function(i){
           updateFunctions.push(function(callback){
             worlds[i].randomNumber = Math.ceil(Math.random() * 10000);
-            worlds[i].save().complete(callback);
+            worlds[i].save().then(callback());
           });
         })(i);
       }
@@ -230,7 +235,7 @@ if (cluster.isMaster) {
       async.parallel(updateFunctions, function(err, updates) {
         res.send(worlds);
       });
-    });  
+    });
 
   });
 

+ 8 - 8
frameworks/JavaScript/express/package.json

@@ -3,14 +3,14 @@
   "version": "0.0.1",
   "private": true,
   "dependencies": {
-    "express": "4.12.3",
-    "body-parser": "1.12.3",
-    "method-override": "2.3.2",
-    "errorhandler": "1.3.5",
-    "async": "0.9.0",
+    "express": "4.14.0",
+    "body-parser": "1.15.2",
+    "method-override": "2.3.6",
+    "errorhandler": "1.4.3",
+    "async": "1.5.2",
     "jade": "1.11.0",
-    "sequelize": "2.0.6",
-    "mysql": "2.6.2",
-    "mongoose": "~4.3.4"
+    "sequelize": "3.6.0",
+    "mysql": "2.11.1",
+    "mongoose": "4.5.3"
   }
 }

+ 6 - 6
frameworks/JavaScript/koa/package.json

@@ -6,12 +6,12 @@
   "private": true,
   "dependencies": {
     "co-monk": "1.0.0",
-    "koa": "0.18.1",
-    "koa-bodyparser": "1.4.1",
-    "koa-handlebars": "0.5.2",
-    "koa-mongo": "0.3.0",
+    "koa": "1.2.0",
+    "koa-bodyparser": "2.0.0",
+    "koa-handlebars": "0.5.7",
+    "koa-mongo": "0.5.0",
     "koa-override": "1.0.0",
-    "koa-route": "2.4.0",
-    "monk": "1.0.1"
+    "koa-route": "2.4.2",
+    "monk": "3.0.6"
   }
 }

+ 10 - 10
frameworks/JavaScript/nodejs/package.json

@@ -3,16 +3,16 @@
   "version": "0.0.1",
   "private": true,
   "dependencies": {
-    "async": "1.5.0",
-    "bluebird": "^2.9.27",
-    "handlebars": "^3.0.3",
-    "mongodb": "2.1.2",
-    "mongoose": "4.3.4",
-    "mysql": "2.7.0",
-    "parseurl": "^1.3.0",
-    "pg": "^4.4.3",
-    "pg-hstore": "^2.3.2",
-    "redis": "^0.12.1",
+    "async": "1.5.2",
+    "bluebird": "3.4.1",
+    "handlebars": "4.0.5",
+    "mongodb": "2.1.1",
+    "mongoose": "4.5.3",
+    "mysql": "2.11.1",
+    "parseurl": "1.3.1",
+    "pg": "6.0.2",
+    "pg-hstore": "2.3.2",
+    "redis": "2.6.2",
     "sequelize": "3.6.0"
   },
   "main": "app.js"

+ 13 - 13
frameworks/JavaScript/sailsjs/package.json

@@ -5,19 +5,19 @@
   "description": "a Sails application for TFB testing",
   "keywords": [],
   "dependencies": {
-    "async": "^1.2.0",
-    "bluebird": "^2.9.27",
-    "ejs": "~2.3.1",
-    "handlebars": "^3.0.3",
-    "hiredis": "^0.4.0",
-    "mysql": "^2.7.0",
-    "pg": "^4.4.0",
-    "pg-hstore": "^2.3.2",
-    "rc": "~1.0.3",
-    "redis": "^0.12.1",
-    "sails": "~0.11.0",
-    "sails-disk": "~0.10.8",
-    "sequelize": "^3.2.0"
+    "async": "1.5.2",
+    "bluebird": "3.4.1",
+    "ejs": "2.4.2",
+    "handlebars": "4.0.5",
+    "hiredis": "0.5.0",
+    "mysql": "2.11.0",
+    "pg": "6.0.2",
+    "pg-hstore": "2.3.2",
+    "rc": "1.1.6",
+    "redis": "2.6.2",
+    "sails": "0.12.3",
+    "sails-disk": "0.10.10",
+    "sequelize": "3.23.4"
   },
   "scripts": {
     "start": "node app.js",

+ 3 - 2
toolset/setup/linux/languages/nodejs.sh

@@ -5,14 +5,15 @@ RETCODE=$(fw_exists ${IROOT}/node.installed)
   source $IROOT/node.installed
   return 0; }
 
-VERSION="5.10.0"
+VERSION="6.3.0"
 
 fw_get -O http://nodejs.org/dist/v$VERSION/node-v$VERSION-linux-x64.tar.gz
 fw_untar node-v$VERSION-linux-x64.tar.gz
 
 NODE_HOME=$IROOT/node-v$VERSION-linux-x64
 # Upgrade npm to avoid https://github.com/npm/npm/issues/4984
-$NODE_HOME/bin/npm install -g npm
+# DISABLED FOR NODE 6 because the npm update line was breaking the install
+# $NODE_HOME/bin/npm install -g npm
 
 echo "export NODE_ENV=production" > $IROOT/node.installed
 echo "export NODE_HOME=${NODE_HOME}" >> $IROOT/node.installed