Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda