Skip to content

Commit

Permalink
Add configureable root path (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
Teddy-1000 authored Nov 29, 2024
1 parent 939cfd0 commit a32542d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Run with:
# For developing: uvicorn main:app --reload
import logging
import os

import metadata_endpoints
from brotli_asgi import BrotliMiddleware
Expand Down Expand Up @@ -30,7 +31,10 @@ def setup_logging():

logger = logging.getLogger(__name__)

app = FastAPI(swagger_ui_parameters={"tryItOutEnabled": True})
app = FastAPI(
swagger_ui_parameters={"tryItOutEnabled": True},
root_path=os.getenv("FASTAPI_ROOT_PATH", ""),
)
app.add_middleware(BrotliMiddleware)
add_metrics(app)

Expand Down

1 comment on commit a32542d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Unit Test Coverage Report
FileStmtsMissCoverMissing
__init__.py00100% 
datastore_pb2.py614821%34–81
datastore_pb2_grpc.py542750%15–16, 19, 65–80, 121–123, 128–130, 135–137, 142–144, 148–173, 219, 246, 273, 300
export_metrics.py100100% 
grpc_getter.py201145%15–19, 23–26, 30–32, 36–38
locustfile.py15150%1–31
main.py44784%49, 54, 64, 74–75, 85–86
metadata_endpoints.py663252%45–54, 58, 85, 100–220, 224
response_classes.py50100% 
utilities.py1803978%21, 39, 46, 68–71, 79–90, 95–102, 122, 126, 128, 156, 162, 180, 238–244, 248–250, 280, 284, 306, 311
custom_geo_json
   edr_feature_collection.py60100% 
formatters
   __init__.py110100% 
   covjson.py60198%91
   geojson.py21290%27, 52
openapi
   custom_dimension_examples.py40100% 
   edr_query_parameter_descriptions.py110100% 
   openapi_examples.py130100% 
routers
   __init__.py00100% 
   edr.py101496%348–349, 438–439
   feature.py471960%99–132, 148–153, 159–181
TOTAL72920572% 

Title Coverage Tests Skipped Failures Errors Time
API Unit Tests Coverage 40 0 💤 0 ❌ 0 🔥 1.889s ⏱️
Ingest Unit Tests Coverage 16 0 💤 0 ❌ 0 🔥 11.895s ⏱️

Please sign in to comment.