AWS EC2 Angular 5 ng serve not connecting via browser

后端 未结 3 1016
花落未央
花落未央 2021-01-14 06:04

I managed to get my Angular 5 app running on AWS EC2 Ubuntu...

Started standard Ubuntu instance, used PuTTy to shell in, installed node, entered the next 4 \"magic l

3条回答
  •  囚心锁ツ
    2021-01-14 06:33

    You need to check few things in your EC2 instance first

    • First check that port 4200 or any port that you want to use for Angular is added in security group to accept the traffic.

    • After allowing the port run ng serve with correct domain name or Public DNS shown in EC2 Instance for example

    "ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com"

    Hot Fix:

    If you are getting this error with localhost:4200 you can try ng serve --host 0.0.0.0

    To add specific port you can execute the command as follows: ng serve --host 0.0.0.0 --port 4200

    Hope this will fix your issue.

提交回复
热议问题