21 lines
755 B
JavaScript
21 lines
755 B
JavaScript
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' };
|
|
import { fbURL, jj_firebaseConfig } from './private/config.js';
|
|
|
|
// 파이어베이스 초기화
|
|
if (!admin.apps.find(app => app.name === 'jjungtable')) {
|
|
admin.initializeApp({
|
|
credential: admin.credential.cert(jjungtable_AccKey),
|
|
databaseURL: fbURL,
|
|
}, 'jjungtable');
|
|
}
|
|
|
|
let jj_ClientApp;
|
|
if (!getApps().some(app => app.name === 'jjungtableClientApp')) {
|
|
jj_ClientApp = initializeClientApp(jj_firebaseConfig, 'jjungtableClientApp');
|
|
} else {
|
|
jj_ClientApp = getApp('jjungtableClientApp');
|
|
}
|
|
|
|
export { admin, jj_ClientApp }; |