Running two node servers from a single shell command using a shell script
i have written very simple shell script, for starting MongoDB, start multiple node servers in a new terminal window and open Webstorm Ide.
it uses https://github.com/mklement0/ttab library, for opening new terminal windows.
you can specify multiple projects in code and with simple if elseor maybe with switch statement, differentiate projects.
sh dev.sh waufwauf
will cd and start waufwauf project, hope it helps.
#!/bin/bashif [ "$1" = "waufwauf" ]then cd Code/waufwauf; ttab -d ./ mongod; ttab -d server npm run dev; ttab -d client npm run dev; wstorm ~/Code/waufwauf;elif [ "$1" = "" ]then echo specify project name; else echo $1 unknown project;fi