You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from fastapi.middleware.wsgi import WSGIMiddleware
15
-
from fastapi.middleware.cors import CORSMiddleware
16
11
17
-
from . import models
18
-
from .core import create_app
19
-
from .data import data_source, data_sources
12
+
from fastapi import FastAPI
13
+
from fastapi import Request, Response
20
14
21
-
# ################
22
-
# Dependencies
23
-
# ################
15
+
from fastapi.responses import JSONResponse
24
16
17
+
from fastapi.middleware.wsgi import WSGIMiddleware
18
+
from fastapi.middleware.cors import CORSMiddleware
25
19
26
-
class Sources(str, enum.Enum):
27
-
"""
28
-
A source available for retrieving data.
29
-
"""
30
-
jhu = 'jhu'
31
-
csbs = 'csbs'
20
+
from .core import create_app
21
+
from .data import data_source
32
22
23
+
from .models.location import LocationResponse as Location, LocationsResponse as Locations
24
+
from .models.latest import LatestResponse as Latest
33
25
34
26
# ############
35
27
# FastAPI App
36
28
# ############
37
29
LOGGER = logging.getLogger('api')
38
30
39
-
APP = fastapi.FastAPI(
31
+
APP = FastAPI(
40
32
title='Coronavirus Tracker',
41
33
description='API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. Project page: https://github.com/ExpDev07/coronavirus-tracker-api.',
42
34
version='2.0.1',
@@ -59,7 +51,7 @@ class Sources(str, enum.Enum):
59
51
60
52
# TODO this could probably just be a FastAPI dependency.
0 commit comments