13 Migrating your existing Express.js app to AWS Lambda

 

This chapter covers

  • Running Express.js applications in AWS Lambda and the serverless ecosystem
  • Serving static content from an Express.js application
  • Connecting to MongoDB from a serverless Express.js application
  • Understanding the limitations and risks of Express.js apps in a serverless ecosystem

Express.js is the most important and most used Node.js framework. That’s not without reason: Express.js is easy to use and has a large ecosystem of middleware that can help you build an API or server-rendered web application. But using Express.js still requires a server that will host the application, which means we’re back to the problems this book tries to solve by using serverless technologies. Is there a way to keep your existing Express.js application and still have all the benefits of serverless?

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.

13.1 Uncle Roberto’s taxi application

 
 
 

13.2 Running an Express.js application in AWS Lambda

 
 

13.2.1 Proxy integration

 
 

13.2.2 How serverless-express works

 

13.3 Serving static content

 
 

13.4 Connecting to MongoDB

 

13.4.1 Using a managed MongoDB database with your serverless Express.js app

 
 

13.5 Limitations of serverless Express.js applications

 
 

13.6 Taste it!

 
 
 

13.6.1 Exercise

 
 

13.6.2 Solution

 
 

Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest