Skip to content

Commit

Permalink
Add VITE_FIREBASE_EMULATOR_HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
narze committed Aug 2, 2023
1 parent 9ddbd79 commit e9a5cdb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ export const firestore = initializeFirestore(app, {

// Connect to Firebase Emulator
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
connectAuthEmulator(auth, 'http://localhost:9099');
connectFirestoreEmulator(firestore, 'localhost', 8080);
const firebaseEmulatorHost = import.meta.env.VITE_FIREBASE_EMULATOR_HOST || 'localhost';
console.log({ firebaseEmulatorHost });

connectAuthEmulator(auth, `http://${firebaseEmulatorHost}:9099`);
connectFirestoreEmulator(firestore, firebaseEmulatorHost, 8080);
}

// Function to get the user state
Expand Down

1 comment on commit e9a5cdb

@vercel
Copy link

@vercel vercel bot commented on e9a5cdb Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

chat-os – ./

chat-os-notnarze.vercel.app
chat-os-git-main-notnarze.vercel.app
chat.narze.live
chat-os.vercel.app

Please sign in to comment.