concept AWS Lambda in category node

This is an excerpt from Manning's book Serverless Applications with Node.js.
This book focuses on AWS Lambda because AWS has the most mature serverless infrastructure available in the market, with a stable API and many successful stories behind it.
AWS Lambda is an event-driven serverless computing platform provided by Amazon as part of Amazon Web Services. It is a compute service that runs code in response to events and automatically manages the compute resources required by that code.
Listing 1.1 An example of the smallest working Lambda function with Node.js
function lambdaFunction(event, context, callback) { #1 callback(null, 'Hello from AWS Lambda') #2 } exports.handler = lambdaFunction #3 #1 A function accepts an event, a context, and a callback function. #2 The callback function returns a success message. #3 The function is exported as a handler.
The Express.js web application framework is basically an HTTP server. Serverless applications do not need HTTP servers, because HTTP requests are handled by API Gateway. But fortunately, there is a way to use an existing Express.js application in AWS Lambda with minor modifications. This chapter teaches you how to do that, and it also presents some of the most important limitations of serverless Express.js applications.
Figure 13.2 A static HTML page served from Express.js on AWS Lambda.
![]()