ShieldX commited on
Commit
16a9826
·
verified ·
1 Parent(s): 33564cc

Delete src

Browse files
Files changed (1) hide show
  1. src/firebase.js +0 -31
src/firebase.js DELETED
@@ -1,31 +0,0 @@
1
- const admin = require('firebase-admin');
2
- const dotenv = require('dotenv');
3
-
4
- dotenv.config();
5
-
6
- // Logic: Check if we are in production (HuggingFace) or Local
7
- // In production, we'll parse the JSON string from env vars.
8
- // Locally, we look for the file.
9
-
10
- let serviceAccount;
11
-
12
- try {
13
- if (process.env.FIREBASE_SERVICE_ACCOUNT) {
14
- // Production: Use Env Variable
15
- serviceAccount = JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT);
16
- } else {
17
- // Local: Use file
18
- serviceAccount = require('../serviceAccountKey.json');
19
- }
20
-
21
- admin.initializeApp({
22
- credential: admin.credential.cert(serviceAccount)
23
- });
24
-
25
- console.log("🔥 Firebase Admin Initialized Successfully");
26
- } catch (error) {
27
- console.error("❌ Firebase Admin Init Error:", error.message);
28
- }
29
-
30
- const db = admin.firestore();
31
- module.exports = { db };