[英]Running a UI application on AWS Lambda
Is there a way to run a dynamic UI based application on AWS Lambda?有没有办法在 AWS Lambda 上运行基于动态 UI 的应用程序? If not , why doesn't AWS Lambda fit this use case?
如果不是,为什么 AWS Lambda 不适合这个用例? Since HTTP traffic is stateless and since session can be maintained in a backing datastore , what restricts lambda from hosting a dynamic web application?
由于 HTTP 流量是无状态的,并且会话可以在后备数据存储中维护,那么是什么限制了 lambda 托管动态 Web 应用程序?
No you cannot run.不,你不能跑。 It is to build/run the APIs of your backend as microservices(serverless architecture).
它将后端的 API 构建/运行为微服务(无服务器架构)。 You can either use S3 bucket or Elastic bean stalk to host your UI application.
您可以使用 S3 存储桶或 Elastic bean stalk 来托管您的 UI 应用程序。
No you don't host your web interface lambda.不,您没有托管您的 Web 界面 lambda。 You can utilize S3 static website hosting for hosting your HTML and JS code.
您可以利用 S3 静态网站托管来托管您的 HTML 和 JS 代码。 Lambda can be utilized to provide a backend for any APIs that you need to utilise in your JS code.
Lambda 可用于为您需要在 JS 代码中使用的任何 API 提供后端。
Here is a sample architecture and tutorial to learn more about这是一个示例架构和教程,以了解更多关于
Source : Build a Serverless Web Application来源: 构建无服务器 Web 应用程序
Even though lambda is not designed to host UI application, it doesn't mean that its impossible to do so.尽管 lambda 不是为托管 UI 应用程序而设计的,但这并不意味着它不可能这样做。 I had success running
nodejs express
server in lambda where the express endpoints returned html/css.我在 lambda 中成功运行了
nodejs express
服务器,其中 express 端点返回了 html/css。
when it comes to server side sessions, the session could be saved on the database since lambda is stateless.当涉及到服务器端会话时,会话可以保存在数据库中,因为 lambda 是无状态的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.