Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda