backend/fastapi/app/process/firebase/firebase_app.py

14 lines
514 B
Python
Raw Permalink Normal View History

2025-01-07 06:59:18 +00:00
import firebase_admin
from firebase_admin import credentials, db
def initialize_firebase():
# 1) 서비스 계정 키 경로
cred = credentials.Certificate("/app/allscore-344c2-firebase-adminsdk-4ysfn-6585b694d2.json")
# 2) initialize_app
firebase_admin.initialize_app(cred, {
"databaseURL": "https://allscore-344c2-default-rtdb.asia-southeast1.firebasedatabase.app" # Firebase Realtime Database URL
})
# 이제 이 모듈을 import 하면 어디서든 db.reference() 사용 가능