Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ConnectToDb() {
- var pool = new pg.Pool({
- host: "localhost",
- port: "5432",
- user: "postgres",
- password: "111111",
- database: "HRS"
- });
- pool.connect(function (err,client,done) {
- if(err)console.log("connect " + err.toString());
- else
- client.query('Select* From Info',function (err,result) {
- if(err) console.log("query "+err.toString());
- else console.log(result);
- done();
- });
- });
- pool.end();
- }
- exports.res = ConnectToDb;
Add Comment
Please, Sign In to add comment