EC2 or S3 to host AngularJS app?

后端 未结 3 497
耶瑟儿~
耶瑟儿~ 2021-02-02 00:14

I want to launch a production version of an AngularJS application, and I find Amazon AWS to be an awesome hosting suite. As AngularJS is essentially static it could be hosted on

3条回答
  •  北海茫月
    2021-02-02 01:03

    1) S3 Bucket + CloudFront (CDN) is really fast for static files serving. The Angular minified app is a group of static files which works best here. For the build of those minified files, I recommend using a CI/CD process or build them locally and just upload them to S3.

    2) EC2 requires more work to setup, it consumes resources, it is not necessary for static files or Angular (unless you are using Angular Universal for dynamic content serving), and Node.js is not recommended for static files (Node.js get's blocked since it is single threaded so it is a best practice to keep static files away from it).

    Here is a good article on the topic: https://www.quora.com/Should-I-use-AWS-EC2-to-host-an-Angular-web-app-or-AWS-S3

提交回复
热议问题