[英]How to preview angular app in codeanywhere IDE?
While running angular apps in codeanywhere
or cloud9
, we can not preview the compiled angular or any other web apps.在
codeanywhere
或cloud9
中运行 angular 应用程序时,我们无法预览已编译的 angular 或任何其他 web 应用程序。 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.listening on 0.0.0.0
IP 地址。 ( 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.请使用以下命令确保上述所有点都匹配以编译 angular 应用程序。
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.这里端口号 4201 是我的选择,请随意选择。
Now the codeanywhere IDE is ready to be viewed outside.现在codeanywhere IDE 已准备好在外面查看。 And in some cases, you may not get the preview url to view the app in the browser.
在某些情况下,您可能无法获得预览 url 以在浏览器中查看应用程序。 If so, we've to find the preview url.
如果是这样,我们必须找到预览版 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请根据您的 IDE 自行替换下面提到的关键字
This is not only for angular and applicable for all the web apps. Angular is an example here.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.