Deploying Angular 2 application into AWS Elastic B

2019-07-23 02:28发布

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. 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. Can anyone help guide me to deploy my angular 2 application into AWS Elastic Beanstalk?

Also CAn anyone share any useful documentations for doing this?

2条回答
Emotional °昔
2楼-- · 2019-07-23 02:43

I think it's got something to do with the aws-sdk imported requiring a node runtime environment to execute properly. So the EBS machine and EC2 instances work for that specific use case as hosting a SPA via s3 does not have a nodejs runtime environment.

查看更多
唯我独甜
3楼-- · 2019-07-23 02:49

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

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

  • Go to S3
  • Create new bucket
  • Open bucket
  • Go to "Properties" tab enter image description here
  • Select "Static website hosting" enter image description here
  • Check "Use this bucket to host a website" and provide "index.html" for both index and error pages enter image description here
  • Build solutions using "ng build"
  • Copy build results from "build" folder into this bucket
  • Navigate to links, displayed in "Static website hosting" section
查看更多
登录 后发表回答