Commit 314154f3 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 6eebcd9c
......@@ -19,14 +19,19 @@ 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(e)
console.log('Error Connect pg')
// console.log(e)
}
......@@ -38,9 +43,9 @@ async function refresh() {
arr.push(res.rows[i].normal_username + ' : EAP ' + '"' + res.rows[i].normal_password + '"')
}
res = await client.query('select * from users As u,normal_users As n where u.user_id=n.user_id and group_id=2 and not EXISTS (select user_id from user_attrs As att where att.user_id=u.user_id)')
for (let i = 0; i < res.rows.length; i++) {
arr.push(res.rows[i].normal_username + ' : EAP ' + '"' + res.rows[i].normal_password + '"')
}
// for (let i = 0; i < res.rows.length; i++) {
// arr.push(res.rows[i].normal_username + ' : EAP ' + '"' + res.rows[i].normal_password + '"')
// }
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=2 ')
for (let i = 0; i < res.rows.length; i++) {
......@@ -72,6 +77,8 @@ async function refresh() {
//
// }
console.log('Done')
}
......
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