diff --git a/geomagio/api/ws/app.py b/geomagio/api/ws/app.py index 911d3150d015603985d6c24d8a027dc0b353527f..58fa6d409be763fd1efcc1115ca7463ed5fc1fa7 100644 --- a/geomagio/api/ws/app.py +++ b/geomagio/api/ws/app.py @@ -20,6 +20,7 @@ ERROR_CODE_MESSAGES = { 503: "Service Unavailable", } +metadata_endpoint = os.getenv("METADATA_ENDPOINT", False) VERSION = os.getenv("GEOMAG_VERSION", "version") @@ -28,9 +29,11 @@ app = FastAPI(docs_url="/docs", root_path="/ws") app.include_router(algorithms.router) app.include_router(data.router) app.include_router(elements.router) -app.include_router(metadata.router) app.include_router(observatories.router) +if metadata_endpoint == True: + app.include_router(metadata.router) + @app.middleware("http") async def add_headers(request: Request, call_next):