Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const pg = require('pg'),
- net = require('net'),
- stream = new net.Stream(),
- pgConfig = {
- user: 'user',
- database: 'database',
- password: 'password',
- port: 5432,
- stream: stream
- },
- connectionTimeout = 3000,
- client = new pg.Client(pgConfig);
- stream.setTimeout(connectionTimeout);
- stream.on('timeout', () => {
- console.log('Connection timeout');
- socket.destroy();
- });
- client.connect();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement