Reputation: 41
I'm on a project where the client is serving up the HTML markup of their website via AWS Lambda/API Gateway. I've not seen this approach before.
The best I could find as an explanation was here: How to build front end for Microservices
If someone could tell me what are the benefits of this approach vs. just throwing the .html file in a S3 bucket or another server would be, that would be much appreciated. Thank you for your time.
Upvotes: 4
Views: 609
Reputation: 208
The goal of the Lambdas as I understand them is the exact opposite. You want to use them to create the back-end webservices that the front-end can access from a S3 bucket or any other server. I have used the S3 html -> API Gateway -> Lambdas to create a microservices architecture very effectively.
Using Lambdas directly as the front-end would only make sense if you want to expose as little of the code as possible or if your front-end will be non html (e.g. IoT?). You could have a Front-end Lambda -> API Gateway -> Back-end Lambdas microservices architecture that exposes only the output html or similar (kind of php development vs. javascript).
My opinion is that it will make development a lot more costly and the user interface will suffer. You generally don't want to reinvent the webserver unless there is a security reason for it.
Upvotes: 2