DEV Community

TK
TK

Posted on • Edited on

1 1

Firebase: How to use emulator with express.js

If you use @google-cloud/firestore as firestore client and you want to use emulator, you can connect by below code

// In console

npx firebase emulators:start --project local-project-id

Enter fullscreen mode Exit fullscreen mode

And

// In app.ts
import {Firestore} from '@google-cloud/firestore'

const firestore = new Firestore({
  // Firestore emulator host
  host: 'localhost:4100',
  projectId: 'local-project-id',
  ssl: false,
  eexperimentalForceLongPolling: true
})

Enter fullscreen mode Exit fullscreen mode

Have a good day!!

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay