Skip to content

Commit

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

let serviceAccountLocal: any;
if (location.hostname === "localhost") {
console.log("Using local service account");
serviceAccountLocal = require("../service-account-keys/bryce-jackson-website-firebase-adminsdk-ra4es-7428ff5320.json");
}
// let serviceAccountLocal: any;
// console.log("log spam");
// console.log("location.hostname", location.hostname);
// if (location.hostname === "localhost") {
// console.log("Using local service account");
// 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 @@ -31,15 +33,17 @@ if (location.hostname === "localhost") {
console.log("right outside of the if");
// console.log(serviceAccountLocal);

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

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

initializeApp();

const db = getFirestore();

Expand Down

0 comments on commit 7ad5aa1

Please sign in to comment.