File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1010import uvicorn
1111
1212
13+ # #################################
14+ # Models
15+ # #################################
16+
17+
1318class Totals (pydantic .BaseModel ):
1419 confirmed : int
1520 deaths : int
@@ -51,6 +56,16 @@ class Location(pydantic.BaseModel):
5156 location : Country
5257
5358
59+ # ################
60+ # Dependencies
61+ # ################
62+
63+
64+ # ############
65+ # FastAPI App
66+ # ############
67+ LOGGER = logging .getLogger ("api" )
68+
5469APP = fastapi .FastAPI (
5570 title = "Coronavirus Tracker" ,
5671 description = "API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak." ,
@@ -60,6 +75,15 @@ class Location(pydantic.BaseModel):
6075 redoc_url = "/docs" ,
6176)
6277
78+ # #####################
79+ # Middleware
80+ #######################
81+
82+
83+ # ################
84+ # Routes
85+ # ################
86+
6387
6488@APP .get ("/latest" , response_model = Latest )
6589def get_latest ():
You can’t perform that action at this time.
0 commit comments