Search code examples
node.jsangularlocalhostlocalserver

Local Angular server and Local node server not working for external devices


I'm developing my MEAN application fully locally (Angular frontend and Node Backend). To test this I'm using my mobile with angular command ng serve --host command. When I run my application data from the local node server not loading to mobile but it works with the Laptop browser.


Solution

  • You would need to do following steps:

    (1) Ensure that your local machine and mobile phone are on same WiFi network. (2) Get your local machine IP Address. It will be something like e.g. 184.192.108.xx (3) Run angular application with command ng serve --host 184.192.108.xx

    You can specify the --port and --live-reload options.

    https://angular.io/cli/serve

    Thanks!