Commit 10f58a8b authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent c0d752e1
...@@ -9,7 +9,7 @@ const express = require('express') ...@@ -9,7 +9,7 @@ const express = require('express')
const app = express() const app = express()
const port = 3000 const port = 3000
let moment = require('moment-timezone') let moment = require('moment-timezone')
const connectionString = 'postgresql://ibs:secretpassword@51.91.150.227:5432/IBSng' const connectionString = 'postgresql://ibs:secretpassword@109.237.27.107:5432/IBSng'
const client = new Client({ const client = new Client({
connectionString: connectionString, connectionString: connectionString,
}) })
......
var express = require("express"); const {Client} = require('pg')
var app = express(); let _ = require('lodash')
const fs = require('fs');
var ps = require('ps-node');
const shellExec = require('shell-exec')
const cron = require('node-cron');
const cronKill = require('node-cron');
const express = require('express')
const app = express()
const port = 3000
let moment = require('moment-timezone')
const connectionString = 'postgresql://ibs:secretpassword@109.237.27.107:5432/IBSng'
const client = new Client({
connectionString: connectionString,
})
let arr = []
app.get('/', (req, res) => {
console.log('get file request')
res.sendfile('ikev2.mobileconfig')
})
//client.connect()
app.listen(process.env.PORT || 3000, () => console.log(`Example app listening on port ${port}!`))
async function refresh() {
console.log('Try')
const client = new Client({
connectionString: connectionString,
})
try {
await client.connect()
} catch (e) {
console.log('Error Connect pg')
// console.log(e)
}
let res = await client.query('select * from users As u,normal_users As n,user_attrs AS att where u.user_id=n.user_id and att.user_id=u.user_id and group_id=1')
console.log(res)
}
app.get('/', function(req, res){
res.sendfile('jetmtp.png')
});
// Only works on 3000 regardless of what I set environment port to or how I set [value] in app.set('port', [value]).
app.listen(80);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment