import { initializeApp as initializeClientApp, getApps, getApp } from 'firebase/app'; import admin from 'firebase-admin'; import jjungtable_AccKey from './private/jjungtable-AccountKey.json' assert { type: 'json' }; // 첫 번째 파이어베이스 초기화 (관리자) // if (!admin.apps.find(app => app.name === 'sManager')) { // admin.initializeApp({ // credential: admin.credential.cert(sManager_AccKey), // databaseURL: "https://checkanything-18bf9.firebaseio.com" // }, 'sManager'); // } // 파이어베이스 초기화 if (!admin.apps.find(app => app.name === 'jjungtable')) { admin.initializeApp({ credential: admin.credential.cert(jjungtable_AccKey), databaseURL: "https://jjungtable-e5087-default-rtdb.firebaseio.com" }, 'jjungtable'); } // export const sm_firebaseConfig = { // apiKey: "AIzaSyCxLVOqbrnlDwfx6WMbmTGtCGrUNoL-CqI", // authDomain: "checkanything-18bf9.firebaseapp.com", // projectId: "checkanything-18bf9", // storageBucket: "checkanything-18bf9.appspot.com", // messagingSenderId: "928156583361", // appId: "1:928156583361:web:d157abe34e637fb2395b40", // measurementId: "G-NBSP3XCXX7" // }; export const jj_firebaseConfig = { apiKey: "AIzaSyCHJI2u1lbmHYgKRvPSO9-mPOGENBBPnsg", authDomain: "jjungtable-e5087.firebaseapp.com", databaseURL: "https://jjungtable-e5087-default-rtdb.firebaseio.com", projectId: "jjungtable-e5087", storageBucket: "jjungtable-e5087.appspot.com", messagingSenderId: "480609810019", appId: "1:480609810019:web:b66f72216fa17e1b462a56", measurementId: "G-BQP2SDL40C" }; // 클라이언트 앱 초기화 (이미 초기화된 경우 확인) // let sm_ClientApp; // if (!getApps().some(app => app.name === 'sManagerClientApp')) { // sm_ClientApp = initializeClientApp(sm_firebaseConfig, 'sManagerClientApp'); // } else { // sm_ClientApp = getApp('sManagerClientApp'); // } let jj_ClientApp; if (!getApps().some(app => app.name === 'jjungtableClientApp')) { jj_ClientApp = initializeClientApp(jj_firebaseConfig, 'jjungtableClientApp'); } else { jj_ClientApp = getApp('jjungtableClientApp'); } // export { admin, sm_ClientApp, jj_ClientApp }; export { admin, jj_ClientApp };