jhmt.github.io - Brainmine

Example domain paragraphs

This is an example of Angular Universal app running on AWS Lambda. The finished sample code: jhmt/ng-ssr-on-aws-lambda

Angular Universal works as a middleware for web server frameworks. e.g. Express , Hapi and ASP.NET . Meanwhile, an Express app can work on AWS Lambda with using “aws-serverless-express” node module provided by AWS. In this sample, AWS Lambda renders html with aws-serverless-express and Angular Express Engine .

git clone https://github.com/angular/universal-starter.git Prepare deploy Move “server.ts” and “webpack.server.config.js” in another folder (e.g. “/ssr”) Split the “listen” block into the new file to start in order to reuse the app on AWS Lambda. Modify “webpack:server” script in “package.json” to find the moved webpack file. Make sure “npm run build:ssr” works fine. Initialize Serverless create “serverless.yml” file. serverless create --template aws-nodejs --name ng-ssr-aws-lambda Create Lambda entry point