While running angular apps in codeanywhere
or cloud9
, we can not preview the compiled angular or any other web apps. We're getting blank screen or some error message.
To preview it, we have to do the following checks
listening on 0.0.0.0
IP address.
(If you're listening on 127.0.0.1 (localhost), then it is not available from outside of the Container)And please use this below command to ensure these all above said points are matched to compile angular app.
ng serve --host 0.0.0.0 --port 4201 --disable-host-check
here port number 4201 is of my choice, please feel free to choose your own.
Now the codeanywhere IDE is ready to be viewed outside. And in some cases, you may not get the preview url to view the app in the browser. If so, we've to find the preview url. Let's see how to construct it below:
https://port-4201-containerName-username.preview.codeanywhere.com/
Please replace the below mentioned keyword by your own, according to your IDE
This is not only for angular and applicable for all the web apps. Angular is an example here.