commit
c6b02bf369
12
index.js
12
index.js
@ -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){
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user