This is the part 3 of the series. It's optional. In step 2 of the guide you have all you need to host your prerender website anywhere you prefer.
In the previous steps we have set up Angular Universal and by using npm run prerender
we got the files that are ready to be hosted.
And we have set up a micro backend that knows how to transform markdown files into HTML, and in combination with Angular's prerender create static HTML pages.
Let's setup an AWS S3 bucket to host it.
The full official guide from AWS on WebsiteHosting.
Create the S3 bucket
I'm assuming here you already have an AWS account. If you don't, you can create one here: https://aws.amazon.com.
Once you are logged in your AWS dashboard:
Upload a demo index.html file
Open 'angular-prerender-markdown' bucket and upload a index.html
file from your machine. Go with something simple so you're sure it works.
Configure the bucket for static website hosting
Configure permissions for the bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "MakeItPublic",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::angular-prerender-markdown/*"
}
]
}
🎉 Now your website is hosted on S3 and it's publicly accessible.
👉 Continue with part 4: Automate deployment with Github Actions