Skip to content
Snippets Groups Projects
Commit 07965f6c authored by Rivers, Travis (Contractor) Creighton's avatar Rivers, Travis (Contractor) Creighton
Browse files

add METADATA_ENDPOINT env for public metadata endpoint

parent d4503891
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!22Add readonly, public metadata service
...@@ -20,6 +20,7 @@ ERROR_CODE_MESSAGES = { ...@@ -20,6 +20,7 @@ ERROR_CODE_MESSAGES = {
503: "Service Unavailable", 503: "Service Unavailable",
} }
metadata_endpoint = os.getenv("METADATA_ENDPOINT", False)
VERSION = os.getenv("GEOMAG_VERSION", "version") VERSION = os.getenv("GEOMAG_VERSION", "version")
...@@ -28,9 +29,11 @@ app = FastAPI(docs_url="/docs", root_path="/ws") ...@@ -28,9 +29,11 @@ app = FastAPI(docs_url="/docs", root_path="/ws")
app.include_router(algorithms.router) app.include_router(algorithms.router)
app.include_router(data.router) app.include_router(data.router)
app.include_router(elements.router) app.include_router(elements.router)
app.include_router(metadata.router)
app.include_router(observatories.router) app.include_router(observatories.router)
if metadata_endpoint == True:
app.include_router(metadata.router)
@app.middleware("http") @app.middleware("http")
async def add_headers(request: Request, call_next): async def add_headers(request: Request, call_next):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment