From 172b00b9eeb83e3258cb378a051ca8ebb7efa25f Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 27 Mar 2019 12:28:51 -0400 Subject: [PATCH 1/4] working directory comes from env file --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 6702861..95011ca 100644 --- a/index.js +++ b/index.js @@ -13,8 +13,8 @@ var readline = require('readline'); //------------------------------------------------------- var options = { - key: fs.readFileSync('//var/www/forecast_api/key.pem'), - cert: fs.readFileSync('//var/www/forecast_api/cert.pem'), + key: fs.readFileSync(wd + 'key.pem'), + cert: fs.readFileSync(wd + 'cert.pem'), passprase: [] }; @@ -47,9 +47,9 @@ Postgres.FirstRow = function (inSQL, args, inResponse) { server.get('/', (req, res) => res.send('node.js express is up and running')) -server.get('/login', (req, res) => res.sendFile('//var/www/forecast_api/msauth.html')) +server.get('/login', (req, res) => res.sendFile(wd + 'msauth.html')) -server.get('/logs', (req, res) => res.sendFile('//var/www/forecast_api/logs.html')) +server.get('/logs', (req, res) => res.sendFile(wd + 'logs.html')) server.get('/test_sql', function(req, res){ From 6c0e98b13e6f2658cb49f44478fbfb43dac6023f Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 27 Mar 2019 12:50:09 -0400 Subject: [PATCH 2/4] specifiy env --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 95011ca..3dc0805 100644 --- a/index.js +++ b/index.js @@ -13,8 +13,8 @@ var readline = require('readline'); //------------------------------------------------------- var options = { - key: fs.readFileSync(wd + 'key.pem'), - cert: fs.readFileSync(wd + 'cert.pem'), + key: fs.readFileSync(process.env.wd + 'key.pem'), + cert: fs.readFileSync(process.env.wd + 'cert.pem'), passprase: [] }; @@ -47,9 +47,9 @@ Postgres.FirstRow = function (inSQL, args, inResponse) { server.get('/', (req, res) => res.send('node.js express is up and running')) -server.get('/login', (req, res) => res.sendFile(wd + 'msauth.html')) +server.get('/login', (req, res) => res.sendFile(process.env.wd + 'msauth.html')) -server.get('/logs', (req, res) => res.sendFile(wd + 'logs.html')) +server.get('/logs', (req, res) => res.sendFile(process.env.wd + 'logs.html')) server.get('/test_sql', function(req, res){ From 0c08dae349a5c5b875987151dec696e305050f11 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 27 Mar 2019 11:59:21 -0500 Subject: [PATCH 3/4] variabalize port --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3dc0805..db91ac4 100644 --- a/index.js +++ b/index.js @@ -18,8 +18,8 @@ var options = { passprase: [] }; -https.createServer(options,server).listen(3000, () => { - console.log('started on 3000') +https.createServer(options,server).listen(process.env.nodeport, () => { + console.log('started on '+ process.env.nodeport) }); //server.listen(3000, () => console.log('started')) From d3e1ea47bd8af01738d33ed1fec98ad40fcb4aa6 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 27 Mar 2019 12:24:49 -0500 Subject: [PATCH 4/4] include change type --- route_sql/build/list_changes_table.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/route_sql/build/list_changes_table.sql b/route_sql/build/list_changes_table.sql index 3011b65..a6b7bfa 100644 --- a/route_sql/build/list_changes_table.sql +++ b/route_sql/build/list_changes_table.sql @@ -1,7 +1,7 @@ SELECT iterdef->>'user' "user", (iterdef->>'stamp')::timestamptz "stamp", - iterdef->>'mesasage' "comment", + iterdef->>'type' "type", round(SUM(fb_val_loc * r_rate)::numeric,2) sales, jsonb_pretty(iterdef) def FROM @@ -11,7 +11,7 @@ WHERE GROUP BY iterdef->>'user', iterdef->>'stamp', - iterdef->>'message', + iterdef->>'type', iterdef ORDER BY "stamp" DESC