Merge pull request #2 from fleetside72/dev

parameterize path and port
This commit is contained in:
fleetside72 2019-03-27 13:35:51 -04:00 committed by GitHub
commit c6b02bf369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -13,13 +13,13 @@ var readline = require('readline');
//------------------------------------------------------- //-------------------------------------------------------
var options = { var options = {
key: fs.readFileSync('//var/www/forecast_api/key.pem'), key: fs.readFileSync(process.env.wd + 'key.pem'),
cert: fs.readFileSync('//var/www/forecast_api/cert.pem'), cert: fs.readFileSync(process.env.wd + 'cert.pem'),
passprase: [] passprase: []
}; };
https.createServer(options,server).listen(3000, () => { https.createServer(options,server).listen(process.env.nodeport, () => {
console.log('started on 3000') console.log('started on '+ process.env.nodeport)
}); });
//server.listen(3000, () => console.log('started')) //server.listen(3000, () => console.log('started'))
@ -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('/', (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(process.env.wd + 'msauth.html'))
server.get('/logs', (req, res) => res.sendFile('//var/www/forecast_api/logs.html')) server.get('/logs', (req, res) => res.sendFile(process.env.wd + 'logs.html'))
server.get('/test_sql', function(req, res){ server.get('/test_sql', function(req, res){

View File

@ -1,7 +1,7 @@
SELECT SELECT
iterdef->>'user' "user", iterdef->>'user' "user",
(iterdef->>'stamp')::timestamptz "stamp", (iterdef->>'stamp')::timestamptz "stamp",
iterdef->>'mesasage' "comment", iterdef->>'type' "type",
round(SUM(fb_val_loc * r_rate)::numeric,2) sales, round(SUM(fb_val_loc * r_rate)::numeric,2) sales,
jsonb_pretty(iterdef) def jsonb_pretty(iterdef) def
FROM FROM
@ -11,7 +11,7 @@ WHERE
GROUP BY GROUP BY
iterdef->>'user', iterdef->>'user',
iterdef->>'stamp', iterdef->>'stamp',
iterdef->>'message', iterdef->>'type',
iterdef iterdef
ORDER BY ORDER BY
"stamp" DESC "stamp" DESC