Spaces:
Sleeping
Sleeping
Download app/infra/firebase.py from bichnhan2701/NoteServicesAPI: direct link, hf CLI and curl.
- Browser
- Download file 269 Bytes
-
https://huggingface.co/spaces/bichnhan2701/NoteServicesAPI/resolve/main/app/infra/firebase.py
- Command line
-
hf download hf://spaces/bichnhan2701/NoteServicesAPI/app/infra/firebase.py
-
curl -L -o firebase.py https://huggingface.co/spaces/bichnhan2701/NoteServicesAPI/resolve/main/app/infra/firebase.py
269 Bytes
| import firebase_admin | |
| from firebase_admin import credentials, firestore | |
| import os, json | |
| if not firebase_admin._apps: | |
| cred = credentials.Certificate(json.loads(os.environ["FIREBASE_SERVICE_ACCOUNT"])) | |
| firebase_admin.initialize_app(cred) | |
| db = firestore.client() |