From the course: Build REST APIs with FastAPI

Unlock this course with a free trial

Join today to access over 24,200 courses taught by industry experts.

Challenge: Make a server production ready

Challenge: Make a server production ready - Python Tutorial

From the course: Build REST APIs with FastAPI

Challenge: Make a server production ready

In this challenge, I would like you to make this server production-ready. So the server itself calculates some statistics about the CSV file with some information about one of my jobs, right? So I have time, latitude, longitude, and height. And the server is reading the request body, getting the count; how many rows they were, the distance, and the speed, and returns a JSON object for that effect. Right. So plug some security holes. There are some security holes there. Add some logging so you can see what's going on and add some metrics. See how it goes. Just to show you that the code actually runs. So fastapi dev and we're at Ch05/challenge/server.py. Right. And server is running. And if you do the request, and no, I do not want to do that, I can send the request. And you see that we got 740 lines in the CSV file, the distance is about 4.7 kilometers, and the speed is about 8.6 kilometers per hour.

Contents