将Angular 2应用程序部署到AWS Elastic Beanstalk中

问题描述:

我现在正在使用angular 2开发一个前端应用程序.此id用于与部署在云中的另一个微服务进行通信.在这个Angular 2应用程序中,我没有使用数据库交互.

I am now developing a front-end application using angular 2. This id for communicating with another micro services deploying in cloud. In this Angular 2 application I am not using database interaction.

我需要在弹性beantalk(AWS PaaS)中部署此Angular 2应用程序.部署到云中需要遵循哪些重要步骤?我是角度框架和云平台的新手.如何将Angular 2应用程序部署到AWS Elastic Beanstalk中?

I need to deploy this Angular 2 application in elastic beanstalk (AWS PaaS). What are the important procedure that I need to follow for deploying into cloud? I am new to angular framework and cloud platforms. How can I deploy my Angular 2 application into AWS Elastic Beanstalk?

您是否需要完全弹性beantalk,或者仅使用建议的解决方案部署到AWS?

Do you need exactly to elastic beanstalk or you need just deploy to AWS using any suggested solutions?

如果第二种方法(最简单的方法是将Angular2部署到配置为提供静态文件的S3存储桶):

If second - simplest way is to deploy Angular2 to S3 bucket, configured to serve static files:

  • 转到S3
  • 创建新存储桶
  • 打开水桶
  • 转到属性"标签
  • 选择静态网站托管"
  • 选中使用此存储桶托管网站",并为索引页面和错误页面提供"index.html"
  • 使用"ng build"构建解决方案
  • 将构建结果从"build"文件夹复制到此存储桶中
  • 导航到链接,显示在静态网站托管"部分
  • Go to S3
  • Create new bucket
  • Open bucket
  • Go to "Properties" tab
  • Select "Static website hosting"
  • Check "Use this bucket to host a website" and provide "index.html" for both index and error pages
  • Build solutions using "ng build"
  • Copy build results from "build" folder into this bucket
  • Navigate to links, displayed in "Static website hosting" section