Skip to content
Snippets Groups Projects
Commit efec3050 authored by Steve Battle's avatar Steve Battle
Browse files

port

parent 15014b07
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
......@@ -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"
}
}
// 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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment