-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add firebase and routing in client side
- Loading branch information
1 parent
beceec4
commit 1713c09
Showing
7 changed files
with
1,046 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Import the environment variables | ||
import './config.js'; | ||
|
||
// Import Firebase functions | ||
import { initializeApp } from 'firebase/app'; | ||
import { getAuth, GoogleAuthProvider } from 'firebase/auth'; | ||
import { getFirestore } from 'firebase/firestore'; | ||
import { getStorage } from 'firebase/storage'; | ||
|
||
// Your web app's Firebase configuration | ||
const firebaseConfig = { | ||
apiKey: process.env.FIREBASE_API_KEY, | ||
authDomain: process.env.FIREBASE_AUTH_DOMAIN, | ||
projectId: process.env.FIREBASE_PROJECT_ID, | ||
storageBucket: process.env.FIREBASE_STORAGE_BUCKET, | ||
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID, | ||
appId: process.env.FIREBASE_APP_ID, | ||
measurementId: process.env.FIREBASE_MEASUREMENT_ID, | ||
}; | ||
|
||
// Initialize Firebase | ||
const app = initializeApp(firebaseConfig); | ||
const auth = getAuth(app); | ||
const db = getFirestore(app); | ||
const googleProvider = new GoogleAuthProvider(); | ||
const storage = getStorage(app); | ||
|
||
export { auth, googleProvider, db, storage }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { config } from 'dotenv'; | ||
|
||
// Load environment variables from .env.local | ||
config({ path: '.env.local' }); |
Oops, something went wrong.