Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to start nodejs server from QT program?
Qt 6.11 is out! See what's new in the release blog

How to start nodejs server from QT program?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qrum
    wrote on last edited by
    #1

    Im working on QT program using nodejs (communicate by socket). How can I start nodejs server automatic with the QT application?

    I have installed 'forever' module to start node server easy.

    qt code:
    @QProcess p;
    p.start("cmd.exe", QStringList()<<"/C"<< qApp->applicationDirPath() + "/debugReq/startNode.bat");
    p.waitForFinished();
    qDebug() << p.readAllStandardOutput();@

    I know this works because shows script's outputs.

    startNode.bat:
    @forever start server.js@

    Server works when i run it by clicking startNode.bat file but when i run from QT it only show outputs but server doesnt start. What am i doing wrong?

    "stackoverflow":http://stackoverflow.com/questions/27166980/how-to-start-nodejs-server-from-qt-program

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved