Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up an AngularJS app using AWS?

Would I use an EC2 instance and install a web server (such as Node.js) on it and then do everything as per usual or do I have to use something such as the AWS SDK for JavaScript?

(This is not a static AngularJS app and will be interacting with an application server)

like image 757
dillib Avatar asked Jun 30 '16 19:06

dillib


2 Answers

If your app only use angular js, then you can use amazon s3 bucket to host your static website. Static website does not need any webserver. Here is the tutorial to get started.

If your app use nodejs as a server, then you need to login to your ec2 instance, and then install node js. Once installed, just run the app with node. Also make sure that you allow the nodejs port in security group setting of your instances.

I remember following this blog, whenever I deployed node+angular app for the first time.

Node-Aws-Sdk is an ec2 library that is used for calling various aws services like Amazon S3, Amazon EC2, DynamoDB, and Amazon SWF. I don't think you need this unless you are interacting with these services in your nodejs code.

like image 124
Ritesh Kumar Gupta Avatar answered Sep 27 '22 17:09

Ritesh Kumar Gupta


You should be able to just put it in an S3 bucket and make it public. You are just serving javascript, you don't need to run it off a EC2 instance.

like image 37
Daniel Cottone Avatar answered Sep 27 '22 17:09

Daniel Cottone