Chapter 9: Deploying FastAPI Applications

In the last chapter, you learned how to write tests for API endpoints created in a FastAPI application. We started by learning what testing means and walked through the basics of unit testing using the pytest library. We also looked at how to eliminate repetition and reuse test components with fixtures and then proceeded to set up our test environment. We wrapped up the last chapter by writing tests for each endpoint and then testing them alongside checking the test coverage reports after testing.

In this chapter, you’ll learn how to deploy your FastAPI application locally using Docker and docker-compose. A brief section is also added with external resources to deploy your application on serverless platforms ...

Get Building Python Web APIs with FastAPI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.