简体   繁体   English

AWS Cloud9 与 Angular 9

[英]AWS Cloud9 with Angular 9

My developing laptop just broke down and I launched and cloud9 EC2 instance on AWS.我正在开发的笔记本电脑刚刚坏了,我在 AWS 上启动了 cloud9 EC2 实例。 I can compile my angular 9 without any problems.我可以毫无问题地编译我的 angular 9。 ng serve --host 0.0.0.0 --port 8080 --disable-host-check But when I click then on preview I get this message in the browser: Oops VFS connection does not exist Also, if I try to open up in a new tab, it loads for ever and at some point he gives me the error of: took to long to respond . ng serve --host 0.0.0.0 --port 8080 --disable-host-check但是当我点击预览时,我在浏览器中收到这条消息: Oops VFS connection does not exist另外,如果我尝试在新标签,它永远加载,在某些时候他给了我错误: took to long to respond The url is some ipv4:8080 Any idea what I need to configure? url 是一些 ipv4:8080 知道我需要配置什么吗?

The only way I managed to get it to work was using ngrok, which forwards your http request to your ec2 instance.我设法让它工作的唯一方法是使用 ngrok,它将您的 http 请求转发到您的 ec2 实例。 Not a clean solution, but its working.不是一个干净的解决方案,但它的工作。 https://ngrok.com/ https://ngrok.com/

Have you tried to disable Ad Blockers and Privacy Extensions?您是否尝试过禁用广告拦截器和隐私扩展? It may help.它可能会有所帮助。

If anyone is still struggling with this, the trick is to open up 4200 in your EC2 firewall (security group).如果有人还在为此苦苦挣扎,诀窍是在您的 EC2 防火墙(安全组)中打开 4200。

Please note the security implications of doing this.请注意这样做的安全隐患。

Here is the article that solved it for me: https://jorgeavante.com/posts/running-an-angular-project-in-aws-cloud9/这是为我解决它的文章: https://jorgeavante.com/posts/running-an-angular-project-in-aws-cloud9/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM