초기 PM 소스 전체 업로드
This commit is contained in:
14
db/index.js
Normal file
14
db/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const pool = require('./pool.js');
|
||||
require('dotenv').config();
|
||||
|
||||
module.exports = async () => {
|
||||
let client;
|
||||
try {
|
||||
client = await pool.connect();
|
||||
console.log(`📡 [db/index.js] ${process.env.DEPLOYMENT_TYPE} DB 연결 성공`);
|
||||
} catch (err) {
|
||||
console.error('📡 [db/index.js] DB 연결 에러:', err.stack);
|
||||
} finally {
|
||||
client.release(); // 연결 객체를 풀에 반환합니다.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user