Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running multiple apps at the same time?

I want to run multiple apps at the same time with angular-cli.

I've followed these steps: https://yakovfain.com/2017/04/06/angular-cli-multiple-apps-in-the-same-project/

If I serve app0 or app1, they run without any problem. But my problem is, I want these apps run at the same time. Some routes should run app0, some routes should run app1.

In package.json, I wrote this script:

"develop-both": "ng serve --app 0 --proxy-config proxy.conf.json && ng serve --app 1 --proxy-config proxy.conf.json"

But this script only runs first app in angular-cli.json. How can I achieve that?

like image 735
Emre Alparslan Avatar asked Sep 11 '26 14:09

Emre Alparslan


1 Answers

SOLUTION

I've found the solution for running multiple scripts with the help of David in comment section of the question.

Here is how I run multiple scripts:

"develop-both": "ng serve  --app 0 --proxy-config proxy.conf.json --port 4200 | ng serve  --app 1 --proxy-config proxy.conf.json --port 4201"

I needed to run these apps in different ports. One of them is running in 4200, the other running in 4201.

like image 152
Emre Alparslan Avatar answered Sep 14 '26 12:09

Emre Alparslan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!