问题
While experimenting with Angular 2, I happened to see Angular Universal. It's Server-side Rendering for Angular 2 apps same like we have in ReactJs. There is also a getting started guide with one code snippet here.
I am trying to understand if this is something we can deploy in serverless environment like Google Cloud Function or AWS Lambda. Docs of both services indicates that nodejs is supported. I am very new to both Angular2 & serverless hosting pattern.
回答1:
It is possible to deploy Angular app on serverless environment. I could say more, it is possible with server-side rendering (Angular Universal).
Check out this boiler-plate repo: https://github.com/maciejtreder/angular-universal-pwa
and live demo: https://www.angular-universal-pwa.maciejtreder.com
The app is deployed using Serverless framework: https://serverless.com
回答2:
Don't think so. It says you need to use angular2+webpack and that starter guide says it requires node version => 5. AWS lambda supports only 4.3.2.
Don't know about google functions.
来源:https://stackoverflow.com/questions/40282468/deploying-universal-angular-on-google-cloud-function-or-aws-lambda