-
Notifications
You must be signed in to change notification settings - Fork 12k
ng serve method ip not open in another machines #2542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The solution is simple. Just bind to the correct interface address via |
@Coksnuss , Hi thanks for your reply any possible way to set in file for default ip for run time |
@Coksnuss , Is building this method but not running in browser ng serve --host 10.0.136.126 |
Not sure about the run-time setting. Regarding the binding: Bind to |
Looks like the default host address cannot be set in any other way. However, you may set the |
Oh ok we can given manual at build time only correct. |
10.0.136.126 is private ip, use the public ip ;) |
@fedecordova private that one is ok how can i access in other machines that is a issue 👍 |
use a digitalocean droplet, like ubuntu |
using following in the package.json makes it accessible to the host machine |
In case you get |
The option '--disable-host-check' is not registered with the serve command. Run I got it working by actually putting my local ip in the host.
Hope this helps. :) |
@LordAlastair Thanks for pointing that out! Very helpful |
@abhishekdgeek thank you, this problem drove me crazy |
If you want to save the effort of adding the --host flag everytime you run your app just add an entry to the 'defaults' prop in the angular-cli.json file like shown below: angular-cli.json
|
@LordAlastair @gsivaprabu @Coksnuss thank you, very helpful !!! |
In Dockerfile:
Same goes for host is port parameter is not used. |
Should be CMD ["ng", "serve", " --host", "0.0.0.0", "--port", "4201"] Or even better |
run angular with command - ng serve --host=0.0.0.0 --disable-host-check |
Run angular 4 project with this cmd |
I get |
You guys are superb, i am noob in angular, been looking this answer for few days. Thanks a lot :) |
I want to know Angular CLI: 6.2.1 how to config the angular.json ? |
on "serve" put somthing like |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.16
node: 6.6.0
os: linux ia32
After instal angular-cli for below step
npm install -g angular-cli
ng new PROJECT_NAME
cd PROJECT_NAME
After given below command
ng serve
http://localhost:4200 and http://127.0.0.1:4200 is working on same machine only if i open that machine ip with other machine means not opening. How to open the webpage in another machines, like that machine ip is 10.88.186.126 means how to open this url http://10.88.186.126:4200 in other machines browsers in the N/W.
The text was updated successfully, but these errors were encountered: