Shop integration
This commit is contained in:
23
Pottery-website/server/test_db.js
Normal file
23
Pottery-website/server/test_db.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { Pool } = require('pg');
|
||||
require('dotenv').config();
|
||||
|
||||
const pool = new Pool({
|
||||
user: process.env.DB_USER,
|
||||
host: process.env.DB_HOST,
|
||||
database: process.env.DB_NAME,
|
||||
password: process.env.DB_PASSWORD,
|
||||
port: process.env.DB_PORT,
|
||||
});
|
||||
|
||||
async function test() {
|
||||
try {
|
||||
const res = await pool.query('SELECT NOW()');
|
||||
console.log('Connection successful:', res.rows[0]);
|
||||
} catch (err) {
|
||||
console.error('Connection failed:', err);
|
||||
} finally {
|
||||
await pool.end();
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
Reference in New Issue
Block a user