refactor
This commit is contained in:
18
src/config/database.ts
Normal file
18
src/config/database.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Pool } from 'pg';
|
||||
|
||||
export const pool = new Pool({
|
||||
user: 'postgres',
|
||||
host: 'localhost',
|
||||
database: 'kintone_license_server',
|
||||
password: 'psadmin',
|
||||
port: 5432,
|
||||
});
|
||||
|
||||
pool.on('connect', () => {
|
||||
console.log('Connected to PostgreSQL database');
|
||||
});
|
||||
|
||||
pool.on('error', (err) => {
|
||||
console.error('Unexpected error on idle client', err);
|
||||
process.exit(-1);
|
||||
});
|
||||
Reference in New Issue
Block a user