This post illustrates deployment process of Server Side Rendered Angular application, as can be guessed from the title.
Though, AWS has a dedicated service for deploying SSR applications, called AWS Amplify, but, as of writing this post, Angular Universal is not supported by Amplify. There are multiple other options available to achieve the required result. One of the more popular ones were the usage of a third party API, called Serverless. But, It was particularly challenging for me to find a clean and vanilla solution as I was juggling between different options.
Below, I will demonstrate the usage of AWS Elastic Beanstalk to deploy Angular SSR.
Open AWS Management Console and go to Elastic Beanstalk homepage. Click on Create Application.
Next, Give your application a name and click on Create
The console will need an environment, on which the application will run. Click on Create one now and subsequently select Web server environment as demonstrated below.
Now, select Platform and Platform branch for the application and environment created above. Refer to below image for the same.
On the same page, proceed with uploading the zipped dist folder of your Angular app which gets generated upon building your app in the local system. Now, click on Configure more options button.
On the next screen, click on the Edit button on the software tile.
Provide the Node Command considering dist as root. The path used in Node Command generally is of the folder where file to be run is placed.
Save the Configuration and click on Create App subsequently. Environment setup will take a few minutes, after which it will provide the Health status, logs and Deployment URL, as, can be seen below.
Hope, This article is useful for the readers. Please share and provide reactions if you like the blog.
Top comments (1)
Keep up the good work ..