From efec3050829928fe31445a15cc82b2bc7ce210b0 Mon Sep 17 00:00:00 2001
From: Steve Battle <steve.battle@uwe.ac.uk>
Date: Sun, 22 Apr 2018 17:54:17 +0100
Subject: [PATCH] port

---
 node_modules/mysql/package.json | 24 ++++++++++++------------
 package.json                    | 12 ++++++++++--
 server.js                       | 19 ++++++++++++++++++-
 3 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/node_modules/mysql/package.json b/node_modules/mysql/package.json
index 3fcce5d..f0d305d 100644
--- a/node_modules/mysql/package.json
+++ b/node_modules/mysql/package.json
@@ -2,18 +2,18 @@
   "_args": [
     [
       {
-        "raw": "mysql",
+        "raw": "mysql@^2.15.0",
         "scope": null,
         "escapedName": "mysql",
         "name": "mysql",
-        "rawSpec": "",
-        "spec": "latest",
-        "type": "tag"
+        "rawSpec": "^2.15.0",
+        "spec": ">=2.15.0 <3.0.0",
+        "type": "range"
       },
-      "/Users/sa-battle/Documents/javascript/ejsapp"
+      "/Users/sa-battle/Documents/javascript/isd1-2018"
     ]
   ],
-  "_from": "mysql@latest",
+  "_from": "mysql@>=2.15.0 <3.0.0",
   "_id": "mysql@2.15.0",
   "_inCache": true,
   "_installable": true,
@@ -30,13 +30,13 @@
   "_npmVersion": "5.3.0",
   "_phantomChildren": {},
   "_requested": {
-    "raw": "mysql",
+    "raw": "mysql@^2.15.0",
     "scope": null,
     "escapedName": "mysql",
     "name": "mysql",
-    "rawSpec": "",
-    "spec": "latest",
-    "type": "tag"
+    "rawSpec": "^2.15.0",
+    "spec": ">=2.15.0 <3.0.0",
+    "type": "range"
   },
   "_requiredBy": [
     "#USER",
@@ -45,8 +45,8 @@
   "_resolved": "https://registry.npmjs.org/mysql/-/mysql-2.15.0.tgz",
   "_shasum": "ea16841156343e8f2e47fc8985ec41cdd9573b5c",
   "_shrinkwrap": null,
-  "_spec": "mysql",
-  "_where": "/Users/sa-battle/Documents/javascript/ejsapp",
+  "_spec": "mysql@^2.15.0",
+  "_where": "/Users/sa-battle/Documents/javascript/isd1-2018",
   "author": {
     "name": "Felix Geisendörfer",
     "email": "felix@debuggable.com",
diff --git a/package.json b/package.json
index 91f9830..47e9f17 100644
--- a/package.json
+++ b/package.json
@@ -4,8 +4,12 @@
   "description": "",
   "main": "server.js",
   "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1",
-    "start": "node server.js"
+    "test": "mocha",
+    "start": "node server.js",
+    "jsdoc": "./node_modules/.bin/jsdoc"
+  },
+  "directories": {
+    "test": "test"
   },
   "author": "",
   "license": "ISC",
@@ -15,5 +19,9 @@
     "limiter": "^1.1.2",
     "mysql": "^2.15.0",
     "sql": "^0.78.0"
+  },
+  "devDependencies": {
+    "jsdoc": "^3.5.5",
+    "mocha": "^5.0.5"
   }
 }
diff --git a/server.js b/server.js
index 4366f42..9ef4030 100644
--- a/server.js
+++ b/server.js
@@ -1,8 +1,15 @@
-// server.js
+/** 
+ * @module server 
+ * @version 1.0
+ * @requires express
+ * @license open source
+ * @author steve battle
+ */
 
 // see openshift blog
 // https://blog.openshift.com/run-your-nodejs-projects-on-openshift-in-two-simple-steps/
 // use PORT environment variable or default 8080
+console.log(process.env.OPENSHIFT_NODEJS_PORT);
 var port = process.env.OPENSHIFT_NODEJS_PORT || 8080
 
 // load the things we need
@@ -11,6 +18,11 @@ var express = require('express');
 var ws = require('./wslib');
 exports.ws = ws;
 
+/**
+ * Web service options. 
+ * @var {Object} options 
+ */
+
 var conf = require('./config/dev.json');
 var options = conf.options;
 exports.options = options;
@@ -21,6 +33,11 @@ app.set('view engine', 'ejs');
 exports.app = app;
 
 // embed path p for ws invocation
+/** @param {String} p path 
+ * @returns {Object} options
+ * @author steve battle 
+ */
+
 function path(p) {
     options.path = p;
     return options;
-- 
GitLab