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

372
Vistas
How do I check if express server is running from python?

So I call my backend.js from my python code like this

# server is requested to start
startServer = subprocess.Popen(['node', 'backend.js'])
# startServer.wait()
if startServer.poll:
    print('Server could not be started')
    sys.exit()

And my backend.js contains

app.listen(port, () => {
  console.log(`Server is listening at http://localhost:${port}`);
});

How can the backend tell python that server for some reason failed to start and exit the program or server has started and now you can go ahead? I have tried waiting for the startServer to end but that just stops the python code until server is stopped. So is there a way by which the callback function in app.listen can send information to the python code?

about 4 years ago · Juan Pablo Isaza
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