Background

Managing websites and application that are accessible via our domain can be tedious — It requires managing multiple records and understanding what each record points to.

In this post, we explore how Altostra can simplify the process.

What you will need

Certificate

An Amazon Certificate Manager (ACM) certificate that identifies you as the owner of your domain. You can either request a certificate directly from ACM, or import an already existing certificate into it. For more information, read the AWS docs.

Route53 Hosted Zone

An AWS Route53 hosted-zone that corresponds with your domain. Altostra creates the DNS records for you, but you do need to have a pre-existing Route53 DNS Zone to host them.

A hosted zone contains records that define how internet traffic is routed for your domain and its subdomains.

For example, in the _example.com_ hosted zone, you can create records for _example.com_ and _www.example.com_ that route traffic to a web server, CDN or a REST API endpoint.

For more information about how to configure a hosted-zone for your domain read the AWS docs.

Building our domain

We create a project and populate it with the following:

A static website

A web application that has:

  • Statically served client application
  • REST API that serves the logic of the application

A domain to host the website and application

The static website comes included and configured in an Altostra template — so we can use it jump start our project.

Setup

We begin by creating a new project from the static-website template.

Using the alto templates command, we can see which templates are available to us, then using the alto init --template static-website we initialize a new project from that template:

$ mkdir static-website
$ cd static-website

$ alto templates
✔ Getting project templates
Available templates:
* static-website
* ...
$ alto init --template static-website
✔ Getting template 'static-website'
✔ Initializing project
$ npm init -y; echo node_modules > .gitignore
$ git init
$ git add -A .
$ git commit -m "Initial commit"

#aws #web-applications #dns #development #serverless

Deploying a Web App, an API, and a Website under the same domain
2.85 GEEK