edit .env for firebase

This commit is contained in:
kdh8219 2023-04-28 22:00:01 +09:00
parent 79f2042536
commit c229ad4f59
2 changed files with 9 additions and 5 deletions

View file

@ -1,7 +1,7 @@
# FIREBASE # FIREBASE
# cert data to string FIREBASE_CERT_PROJECT_ID =
FIREBASE_CERT = "JSON.stringify(the_file)" FIREBASE_CERT_CLIENT_EMAIL =
FIREBASE_CERT_PRIVATE_KEY =
# DISCORD # DISCORD
# discord bot token # discord bot token
@ -13,4 +13,4 @@ DISCORD_TARGRT_GUILD_ID = ""
# ETC # ETC
# server name # server name
RUNNER_NAME = "" RUNNER_NAME=""

View file

@ -4,7 +4,11 @@ import { config } from "dotenv";
config(); config();
initializeApp({ initializeApp({
credential: cert(JSON.parse(process.env.FIREBASE_CERT as string)), credential: cert({
projectId: process.env.FIREBASE_CERT_PROJECT_ID,
clientEmail: process.env.FIREBASE_CERT_CLIENT_EMAIL,
privateKey: process.env.FIREBASE_CERT_PRIVATE_KEY?.replace(/\\n/g, "\n"),
}),
}); });
const db = getFirestore(); const db = getFirestore();