How to allow access outside localhost in Angular?

Forums AngularHow to allow access outside localhost in Angular?
Staff asked 2 years ago

Answers (1)

Add Answer
monika gabani Marked As Accepted
Staff answered 2 years ago

You can use the following command to access with your ip.

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

If you are using npm and want to avoid running the command every time, we can add the following line to the package.json file in the scripts section.

"scripts": {
    ...
    "start": "ng serve --host 0.0.0.0 --disable-host-check"

}

Then you can run you app using the below command to be accessed from the other system in the same network.

npm start

Subscribe

Select Categories