Kumaresh Babu N S
Kumaresh Babu N S

Reputation: 1698

How to access AngularJS application on Azure Virtual Machine?

I've both NodeJS and AngularJS applications. I'm using npm install to download the app's dependencies for both the application. The NodeJS application runs on port 4000 and AngularJS application runs on port 4200. I can access APIs from NodeJS application in the browser and cannot access the application's UI(AngularJS) in the browser. I have deployed these applications on Azure Virtual Machine.

I have opened the ports 4000 and 4200 in the network settings of Azure VM. I'm using npm start command to start both the applications. NodeJS working fine as like in the local machine but not the same case with AngularJS. There is no errors or warnings from AngularJS side. It shows that the app is listening on http://localhost:4200/ and it is not accessible.

Upvotes: 1

Views: 722

Answers (2)

Shubham Chauhan
Shubham Chauhan

Reputation: 31

Try using:

ng serve --open --host 0.0.0.0 --disable-host-check

Upvotes: 1

Nancy Xiong
Nancy Xiong

Reputation: 28224

In this case, you need to run ng serve --host 0.0.0.0 to allow that your AngularJS application is listening on 0.0.0.0 for outside connecting. You could refer to this How to allow access outside localhost

Upvotes: 3

Related Questions