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

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

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.

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

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire AWS Developer

Looking to Hire Professional AWS Developers? The technology inventions have demanded all businesses to use and manage cloud-based computing services and Amazon is dominating the cloud computing services provider in the world. **[Hire AWS...

Hire Dedicated AWS Developer

Want to Hire AWS Developer for cloud computing services? At **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")**, we leverage maximum benefits from the AWS platform ensuring prominent Solutions for business requirements....

Why Web Development is Important for your Business

With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...

AWS Serverless Web Application tutorial

This article was originally published at https://www.blog.duomly.com/aws-serverless-web-application-tutorial/ --- ### Intro to AWS Serverless Web Application tutorial Today we'll go through the AWS Serverless Web Application tutorial. Nowadays,...

How To Unite AWS KMS with Serverless Application Model (SAM)

AWS KMS is a Key Management Service that let you create Cryptographic keys that you can use to encrypt and decrypt data and also other keys. You can read more about it here.