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

367
Views
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
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!