Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
firebase how do I test if emulator is running?

I am connecting to my storage emulator with the following code:

const firebaseApp = initializeApp(appConfig.firebase)
storage = getStorage(firebaseApp)
connectStorageEmulator(storage, 'localhost', 9199)

This works fine when the emulator is running. It also works fine when the emulator is NOT running! if its not running I want to do something else like this:

if (emulatorIsConnectedAndEmulatorIsRunning) {
  // do something
} else {
  // do something else
}

How can I detect whether the emulator is running or not?

TIA

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is AN answer, not necessarily the best answer and I would appreciate other answers.

Basically, I am not just emulating storage but also cloud functions.

I've made a cloud function like this:

export const ping = functions.https.onRequest((req, res) => {
  res.json({ ping: 'pong' })
})

So in my code I just ping this endpoint. For example:

axios.get(`http://localhost:5001/${storageBucket}/us-central1/ping`)

If it responds 200 then the function emulator is running (and given my setup this also means the storage emulator is running).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!