landunder landunder - 1 year ago 133
Node.js Question

Start node server with .bat file

I want to start a node server with a

file, because everytime I start it, a grunt task has to be run. I tried the following lines in the

grunt build
node index.js

When I execute it, it just runs the
grunt build
command and then stops. If I delete the
grunt build
command it runs the
node index.js
just fine. What am I doing wrong?

Answer Source

If you tie the commands together with && it will make sure the first is run and then the second. grunt build && node index.js If you want them to be on separate lines still, a carrot will remove newlines. grunt build &&^ node index.js

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download