Menu

Deploy Angular 2 + node.js website using AWS – codeburst

November 3rd, 2017

Deploy Angular 2 + node.js website using AWS  #angular #aws #nodejs #javascript

  • The parameters you must be careful about during configuration:VPC instance — make sure that you create a database in same cloud instance you choose for EC2 containerPublic accessibility — for security reasons you should disable access to a database from the Internet.Backup — (optional) if you want to save the state of your DB select this…
  • If the content is not in that edge location, CloudFront retrieves it from an Amazon S3 bucket or an HTTP server (for example, a web server) that you have identified as the source for the definitive version of your content.So if we sum up all this cool stuff, we can…
  • In our configuration, we want to cache requests to S3 bucket because it contains static content (until we would like to deploy a new version of the Angular app to speed up user experience) but we don’t want to do the same with requests for a backend as these are…
  • During this part you must set:Origin Domain Name: choose S3 bucket.Viewer Protocol Policy: Redirect HTTP to HTTPS.Allowed HTTP methods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE.Query String Forwarding and Caching: choose No if your Angular application uses query string routes.Compress Objects Automatically: Yes.Default Root Object: write here your index.html filename.If…
  • To achieve such effect follow steps listed below:In the CloudFront console edit the Distribution Settings.Go to Origins tab and Create Origin.Enter the address of your EC2 component as an Origin Domain Name.Set the Origin Protocol Policy to HTTP Only.Write your server HTTP Port.Click Create.After that, you will create the custom…

For few months, I’ve worked as an only developer in my hobby project called d20md, an interactive website for the well known game system. At the beginning of my adventure I’ve stand against the first…

For few months, I’ve worked as an only developer in my hobby project called d20md, an interactive website for the well known game system. At the beginning of my adventure I’ve stand against the first, serious choose: “How to deploy my application?”. As a newcomer, I’ve just pick the simplest solution so my website landed in VPS. The all-in-one approach works quite well at the start but recently I had realized that I was forced to write the piece of software that should be available out of the box, for example database backup, HTTP request caching and HTTPS protocol support. There were also some problems during deployment of the application because tiny VPS cannot handle serving static content, backend server and database.

Luckily, I’ve realized that there must be other way to have all above things without many hours of work and resources. I’ve decided to migrate the project to AWS (Amazon Web Services) infrastructure. Even if achieving it wasn’t too hard, in the moment I wrote this article there wasn’t any single resource in which you could find all information essential to deploy frontend + backend solution using AWS components. That’s the reason why I’ve decided to write this article.

Although the topic is very wide, in this article I would like to focus mainly on the configuration of AWS services because there are tons of materials about node.js or Angular 2 on the Internet.

Let’s start with a presentation of the system…

Deploy Angular 2 + node.js website using AWS – codeburst