Save this file as run.bat on project-root directory
set type=%1
IF "%type%" EQU "install" (
set command=npm install
) ELSE (
set command=npm run %type%
)
IF "%type%" EQU "" (
set command=npm run dev
)
start cmd /k "cd auth-service && %command% && exit"
start cmd /k "cd user-service && %command% && exit"
start cmd /k "cd product-service && %command% && exit"
start cmd /k "cd order-service && %command% && exit"
As you can see if no parameter passed services will run on dev mode.
From project-root directory open cmd and run command
To install all packages
run.bat install
To run in dev mode ( depends on dev script on respective package.json )
run.bat dev
To run in start mode ( depends on start script on respective package.json )
run.bat start
To run test mode ( depends on test script on respective package.json )
run.bat test
this will start a new cmd on respective directories and start executing given command... It is pretty handy when you need to start all services at once.
Note: Use this only for development stage.