Skip to content

Commit

Permalink
what is going on with my life
Browse files Browse the repository at this point in the history
  • Loading branch information
teenageknight committed Sep 22, 2024
1 parent 239a807 commit c184a67
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ const Geocodio = require("geocodio-library-node");
const { initializeApp, cert } = require("firebase-admin/app");
const { getFirestore } = require("firebase-admin/firestore");

console.log("lets try this");
const test = require("../service-account-keys/test.json");
console.log("test", test);

console.log("right before loading in the service account");
const serviceAccountLocal = require("../service-account-keys/bryce-jackson-website-firebase-adminsdk-ra4es-7428ff5320.json");

let serviceAccountLocal: any;
if (location.hostname === "localhost") {
serviceAccountLocal = require("../service-account-keys/bryce-jackson-website-firebase-adminsdk-ra4es-7428ff5320.json");
}
// FIXME: THIS LIKELY WILL BREAK CD IN THE FUTURE. THIS IS BECUASE THE SERVICE ACCOUNT IS NOT CHECKED
// INTO VERSION CONTROL, I WILL NEED TO ADD THIS AS A .ENV SIMILAR TO THE GEOCODIO API KEY.

Expand All @@ -32,11 +29,16 @@ const serviceAccountLocal = require("../service-account-keys/bryce-jackson-websi
// }
console.log("right outside of the if");
// console.log(serviceAccountLocal);
const config = {
credential: cert(serviceAccountLocal),
};

initializeApp(config);
if (serviceAccountLocal) {
const config = {
credential: cert(serviceAccountLocal),
};

initializeApp(config);
} else {
initializeApp();
}

const db = getFirestore();

Expand Down

0 comments on commit c184a67

Please sign in to comment.