Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

execute multiple commands with angular cli

I have created an Angular app. I have created mock server using json-server plugin from node.

Currently problem with this is, I have to open multiple command prompt to run json server and angular cli.

Is there any way where I can execute both the commands in parallel. OR is there any way where I will run ng serve and in behind it runs the json-server command as well?

like image 914
Jay Patel Avatar asked Sep 14 '25 21:09

Jay Patel


1 Answers

You can try to use the package called concurrently.

npm install concurrently --save-dev

Then setup your package.json scripts:

"start": "concurrently --kill-others \"npm run server\" \"ng serve\""

or on unix systems without the library

"start": "npm run server | ng serve"
like image 116
macvag Avatar answered Sep 16 '25 10:09

macvag