commit
c6b02bf369
12
index.js
12
index.js
@ -13,13 +13,13 @@ 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(process.env.wd + 'key.pem'),
|
||||
cert: fs.readFileSync(process.env.wd + 'cert.pem'),
|
||||
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'))
|
||||
|
||||
@ -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(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){
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user